One way to look at foreach as not so bad

Julio César Carrascal Urquijo jcesar at phreaker.net
Fri Oct 20 16:54:29 PDT 2006


Bill Baxter wrote:
> Maybe I can get used to this version that works now:
>     obj.each( (int i) {
>       wrietfln(i);
>     })
> 
> But it just looks weird to have my loop body inside the parens, and will 
> look even weirder if nested
>     obj.each( (Obj c) {
>       c.each( (int i) {
>         writefln(i);
>       })
>     })

I don't understand your point. You can already write something like:

obj.each = (int i) {
     writefln(i);
};




More information about the Digitalmars-d-announce mailing list