First class lazy Interval

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Feb 27 09:31:58 PST 2009


bearophile wrote:
> As an alternative syntax may be:
> 
> foreach (i; 1:10) {...}
> foreach (i; 10 : 1 : -1) {...}
> foreach (i; 0.0 : 10.5 : 0.5) {...}

I have an idea - we define a contextual keyword "iota" that helps us 
specify from, to, and stride. Then we can write:

foreach (i; iota(0.0, 10.5, 0.5)) {...}


Andrei



More information about the Digitalmars-d mailing list