Super-dee-duper D features
Andrei Alexandrescu (See Website For Email)
SeeWebsiteForEmail at erdani.org
Tue Feb 13 23:28:18 PST 2007
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!
> That said, I understand that Python and Ruby have a little more freedom
> to pile up the abstractions because both of them are so friggin slow
> that a few more layers won't hurt anything. D can't be quite so
> cavalier about tossing performance for elegance.
Yah. Costly abstractions are a dime a dozen.
> Still, I'm remain unconvinced that D can't have both performance and
> elegance.
Macros will get us closer to that.
Andrei
More information about the Digitalmars-d
mailing list