Fully dynamic d by opDotExp overloading

bearophile bearophileHUGS at lycos.com
Sat Apr 18 04:44:57 PDT 2009


downs:
> Static loops are simple, at least in functions.
> ...
> void main() {
>   foreach (i, bogus; Repeat!(void, 15))
>     writefln(i);
> }

My dlibs have:
Range!([start], stop[, step]) 
with it I think your code becomes:

void main() {
    foreach (i; Range!(15))
        putr(i);
}

But a static foreach (on a static data structure that has opApply) is not doable yet, I think.

Bye,
bearophile



More information about the Digitalmars-d mailing list