Re: Parallelism Map and Reduce

2012-12-12 Thread Zardoz
On Tuesday, 11 December 2012 at 17:50:31 UTC, Ali Çehreli wrote: On 12/11/2012 08:12 AM, Zardoz wrote: Could you please move MapIntegrator() to module-level. Then it should work. Ali I try it and now even with normal Map function give me errors with dmd ! public Entity MapIntegrator (

Re: Parallelism Map and Reduce

2012-12-12 Thread Ali Çehreli
On 12/12/2012 05:47 AM, Zardoz wrote: On Tuesday, 11 December 2012 at 17:50:31 UTC, Ali Çehreli wrote: On 12/11/2012 08:12 AM, Zardoz wrote: Could you please move MapIntegrator() to module-level. Then it should work. Ali I try it and now even with normal Map function give me errors with

Re: Parallelism Map and Reduce

2012-12-11 Thread Ali Çehreli
On 12/11/2012 02:53 AM, Zardoz wrote: auto acelByObjs = map!( (Entity o) { Vector3 r = o.pos[0] - pos[0]; return r * (o.mass / pow((r.sq_length + epsilon2), 1.5)); } )(objects); newAcel = reduce!(a + b)(acelByObjs); It works very well with the std.algorithm Map and Reduce but when I try

Re: Parallelism Map and Reduce

2012-12-11 Thread bearophile
Ali Çehreli: The single pointer of the lambda is not sufficient to store both without big changes in the compiler. I think adding a heavier 3-word delegate is not too much hard to do. But it makes the language more complex, so so far Walter is not willing to introduce them. But in the end

Re: Parallelism Map and Reduce

2012-12-11 Thread Zardoz
On Tuesday, 11 December 2012 at 15:22:49 UTC, Ali Çehreli wrote: That used to work a couple of dmd versions ago. I think it was a bug that it worked, so it stopped working after bug fixes. If I'm not mistaken this is actually related to a compiler implementation issue: Lambda's have a single