Automatic Foreach

Bruno Medeiros brunodomedeiros+spam at com.gmail
Tue Apr 29 12:31:58 PDT 2008


Bill Baxter wrote:
> Jarrod wrote:
>>> What do you think?
>> I think Walter really needs to get macros implemented in D.
>>
>> Then we could all make our own little specific loops, which is far 
>> more reasonable. Your idea is well demonstrated, but I don't like the 
>> syntax. It doesn't really tell you what is going on just by looking at 
>> it.
>>
>>
>> PS: You also might want to look at 'map' in phobos2's std.algorithm. 
> 
> Python has map() too, but people prefer to use list comprehensions for 
> some reason.
> 
> --bb

Comprehensions might be syntactically nicer than map, but as for the 
original proposal (automatic foreach), the map construct covers it quite 
nicely and sufficiently.

-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list