Andrei Alexandrescu wrote:

> Speed is a small part of the equation, in fact a perk only. Ranges are
> composable; you can combine them to e.g. do parallel iteration over two
> ranges. Ranges really open std.algorithm to all data structures. I find
> opApply incredibly obtuse and fostering bad design. I wish it goes away.

I'd really hate to see opApply go away.  I'm glad Walter says it's sticking 
around ;)

opApply is really nice in how *simple* it is to write.  I think it's possible 
to use druntime's fibers to convert an opApply implementation into a range 
implementation.  It'd be an interesting challenge to write a templated struct 
that handles all of this.  Once that is done, maybe someone could discuss using 
Fibers to implement opApply in D2.  I suspect the code inside an opApply would 
only change a little bit and it'd allow iteration over multiple "ranges" at the 
same time.

Reply via email to