Steve Yegge's rant on The Next Big Language

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Feb 13 14:33:15 PST 2007


"BCS" <BCS at pathlink.com> wrote in message 
news:eqst6m$29s$2 at digitalmars.com...
>> ....well if you don't write the iterator for your user type, how is the 
>> language going to know how to iterate over it?  When Steve said 
>> "iterators and generators" as a 'thing to have', I think he meant that 
>> they are first-class primitives in the language.  Having to write a 
>> custom iterator for a class wouldn't change that fact.
>>
>
> Strait up question: how does D fail in this regard? opApply and delegate 
> based foreach cover a /lot/ of ground.

I guess it doesn't really miss much functionality, though the way D handles 
iteration certainly makes it harder to do parallel iteration.  I have *no* 
idea how Walter/Andrei plan to implement the "foreach(i;a)(j;b){}" syntax 
that Andrei has been talking about.  On the other hand, many general case 
iterators are far easier to write using the D callback style than with 
iterator style.

Generators, on the other hand, are just plain cool.  I think they can be 
done using something like StackThreads. 





More information about the Digitalmars-d-announce mailing list