Re: Are structs saved in multi-thread delegate call?

2016-04-22 Thread Ramon via Digitalmars-d-learn
mmm, I figured the problem, but don't know how to solve it. my struct has a destructor which clears itself: struct json_value { ~this() { .ValueClear(); } } so how I can I put a struct in the heap? (not in the stack, as is the default..)

Are structs saved in multi-thread delegate call?

2016-04-22 Thread Ramon via Digitalmars-d-learn
I have something along this way: struct json_value { .. } function DoDirSearch(..) { immutable json_value cbk = json_value(prms.argv[3]); assert(cbk != json_value.init); // OK, pass import core.thread; new Thread({ assert(cbk !=

projections in D

2014-11-24 Thread Ramon via Digitalmars-d-learn
what range/algorithm allows me to make projections from one sequence to another? that is, in C#, this is the Select method (http://msdn.microsoft.com/en-us/library/vstudio/bb548891%28v=vs.100%29.aspx) example in C#: class ProjectionWanted { public int field1 { get; set; } public int

Re: projections in D

2014-11-24 Thread Ramon via Digitalmars-d-learn
What is the difference between lazy and eager ranges? (I guess, the lazy one has not yet queried the elements)