iteration over directories is unsafe

2022-02-05 Thread forkit via Digitalmars-d-learn
It is not possible to do a simple iteration over directories in @safe mode. Really? I have to resort to unsafe?? // module test; @safe: // nope. no can do. import std; void main() { auto dFiles = dirEntries("", "*.{d,di}", SpanMode.depth); foreach(d; dFiles)

Re: what's meaning of "(a) =>"

2022-02-05 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 5 February 2022 at 15:10:19 UTC, step8 wrote: I'm trying to study D programming Following is code from vibe's example(web_ajax) code: void getDataFiltered(Fields field, string value) { auto table = users.filter!((a) => value.length==0 || a[field]==value)().array();

what's meaning of "(a) =>"

2022-02-05 Thread step8 via Digitalmars-d-learn
I'm trying to study D programming Following is code from vibe's example(web_ajax) code: void getDataFiltered(Fields field, string value) { auto table = users.filter!((a) => value.length==0 || a[field]==value)().array(); render!("createTable.dt", table)(); } I can't understand