map! filter! and range algorithm

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 5 19:02:55 PST 2013


On Wed, Mar 06, 2013 at 03:11:42AM +0100, Jesse Phillips wrote:
> On Monday, 4 March 2013 at 20:49:22 UTC, Andrea Fontana wrote:
> 
> >Very interesting. IMHO that should be pointed out better in
> >docs/example.
> >You say interleaving is "default", how can I guess if a function
> >doesn't use the "default" behaviour?
> 
> It doesn't really make sense to point it out in the example since it
> is kind of fundamental to what ranges are. If it is eager than the
> docs should mention that.
> 
> If an operation requires all its data upfront, sort, then you'll
> usually see a call for .array().

A range is an abstraction akin to C++'s iterators (except better, IMO).
Just as iterators do not spontaneously consume the underlying data until
you iterate over them, neither do ranges.


T

-- 
In a world without fences, who needs Windows and Gates? -- Christian Surchi


More information about the Digitalmars-d-learn mailing list