Fully dynamic d by opDotExp overloading

downs default_357-line at yahoo.de
Sat Apr 18 05:01:17 PDT 2009


bearophile wrote:
> 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

Foreach on a tuple is evaluated at compile-time.



More information about the Digitalmars-d mailing list