Re: merging map/filter/reduce/... in D

2016-01-29 Thread glathoud via Digitalmars-d-learn
Thanks. I am glad be wrong on that one. I had a look at map & filter in the source code ; pleased to see they're lazily implemented! map https://github.com/D-Programming-Language/phobos/blob/master/std/algorithm/iteration.d#L425 filter

Re: merging map/filter/reduce/... in D

2016-01-29 Thread cym13 via Digitalmars-d-learn
On Friday, 29 January 2016 at 08:06:14 UTC, glathoud wrote: Thanks. I am glad be wrong on that one. I had a look at map & filter in the source code ; pleased to see they're lazily implemented! map https://github.com/D-Programming-Language/phobos/blob/master/std/algorithm/iteration.d#L425

Re: merging map/filter/reduce/... in D

2016-01-28 Thread Ivan Kazmenko via Digitalmars-d-learn
On Friday, 29 January 2016 at 07:17:04 UTC, glathoud wrote: I have the impression that function implementations are not merged: return fun0(fun1(a)); For example, fun1(a) outputs a temporary array, which is then used as input for fun0. Merging the implementations of fun0 and fun1 would

merging map/filter/reduce/... in D

2016-01-28 Thread glathoud via Digitalmars-d-learn
Hello, I am a D beginner, please excuse me if these questions are irrelevant. I had a look at this post: http://forum.dlang.org/post/aarldotsgluwdgtee...@forum.dlang.org Looking at the source code of compose!: