Andrei Alexandrescu Wrote:

> (I originally emailed this to Walter and a couple others, but I thought 
> it might be better to gather insights from the community.)
> 
> I'm gearing up for changing std.algorithm, and I am thinking of making 
> the major change of favoring lazy evaluation throughout. (snip)

I am behind this change 100%. Awesome that range support enabled this 
functionality. I haven't used std.algorithm in a few months so I apologize if 
I'm out of date here, but you might want to start thinking about stream fusion 
too -- "fusing" multiple std.algorithm calls (map, fold, etc.) together so that 
you can pipeline computations and only ever allocate to get the final result.

Then with range support in streams, we could read in a stream, apply multiple 
transformations via std.algorithm, and then write to another stream all without 
extra allocation for intermediate results!

Reply via email to