Categorizing Ranges

Joseph Rushton Wakeling via Digitalmars-d digitalmars-d at puremagic.com
Sat Oct 10 00:20:11 PDT 2015


On Wednesday, 7 October 2015 at 15:39:03 UTC, Jonathan M Davis 
wrote:
> Eager is far more general. Also, while the drop* functions are 
> eager, the take* functions are not.

I don't recall the precise details of these particular ranges off 
the top of my head (away from computer so can't easily check), 
but one nasty little detail of supposedly lazy ranges is that 
they are often eager for the first element, lazy thereafter -- 
and even there it's subtly different from 'true' laziness 
inasmuch as the new values are generated at the point of popping 
rather than the point of access to the new front.

In most cases that's an implementation detail, but it gets _very_ 
interesting when the elements of your range are non-deterministic.


More information about the Digitalmars-d mailing list