Super-dee-duper D features

Bill Baxter dnewsgroup at billbaxter.com
Tue Feb 13 23:45:53 PST 2007


Andrei Alexandrescu (See Website For Email) wrote:
> Bill Baxter wrote:
>> Andrei Alexandrescu (See Website For Email) wrote:
>>
>>
>>> I'm actually mildly surprised. Lately there was some talk around here 
>>> about supporting the day-to-day programmers and so on. I find looping 
>>> a very day-to-day thing, and looping over 2+ things at least a 
>>> few-days-to-few-days thing. There is a need for parallel iteration, 
>>> if nothing else shown by the existence of a library that addresses 
>>> exactly that - to the extent possible in a library that's not in the 
>>> position to control syntax, scoping, and visibility. I was sure 
>>> people will be on this one like white on rice. But Bjarne Stroustrup 
>>> was right: nobody knows what most programmers do :o).
>>
>> Python and Ruby are hardly considered to be obtuse languages, or 
>> unfriendly to Joe coder, but both get by just fine without special 
>> case syntax for iterating over multiple collections, or for iterating 
>> in reverse.
>>    for x,y izip(foo,bar):
>>        do stuff
>>
>>    for x reversed(foo):
>>        do stuff
>>
>>    for x,y izip(reversed(foo),bar):
>>        do that with your proposal!
> 
> foreach (x ; reverse_view(foo)) (y ; bar)
>   probably I could!

foreach (x,y ; transpose_view(reverse_view(foo),bar)
   then why not this too?!

--bb



More information about the Digitalmars-d mailing list