DMD 0.170 release

Lutger lutger.blijdestijn at gmail.com
Tue Oct 17 12:16:54 PDT 2006


Vladimir Kulev wrote:
> J Duncan wrote:
>> Disagree with you, its a nice thing to have.
> 
> There are many things which are nice to have, but only really essential ones
> should be in language itself. Reverse foreach can be implemented in other
> way.

But there are some benefits to having foreach_reverse, this I could 
think of right now:
- foreach and foreach_reverse are the basic kinds of iteration, 
supporting them both with a keyword and other kinds with a delegate 
makes sense as it looks more consistent imho.
- having foreach_reverse means that reverse iteration will likely be 
done with the same syntax across code from different people.
- it stands out more in code (syntax highlighting), I think this will be 
easier to read.

Sure it is syntactic sugar, but the D language does have a lot of sugar 
(more than most languages probably) and it can be pretty sweet.

I'm not saying it's better to have foreach_reverse perse, but it does 
have some benefits.








More information about the Digitalmars-d-announce mailing list