DMD 0.170 release

Walter Bright newshound at digitalmars.com
Wed Oct 18 11:52:55 PDT 2006


Oskar Linde wrote:
> One example of a generalizing addition is Tomasz' suggestion for 
> trailing delegates. It generalizes foreach, foreach_reverse and even the 
> while-loop. Such an addition would not only make libraries simpler and 
> more powerful.

foreach_reverse is about as simple as one can get, from a user 
standpoint. It also works efficiently with arrays, which is hugely 
important because most of the time it will be used for arrays.

> It could also simplify the core language.

foreach_reverse was pretty trivial to implement. All the machinery was 
already there.

> What is design if not the pursuit of simplicity?

Simplicity is sometimes an elusive goal. For example, D started out with 
a simple syntax for function literals. Nobody used it, nobody even 
noticed it, people kept asking for the feature even after I pointed it 
out to them that D had it. Then, I figured out a way to eliminate some 
of the extra syntax for it, and voila! suddenly it gets noticed. This is 
even though the newer style is harder to parse and implement.

I also remember a thread here about D versus Ruby, and how everything 
was so simple in Ruby. It didn't matter that I showed how it could be 
done in D, it appeared to be simpler in Ruby, and that apparently made 
all the difference.



More information about the Digitalmars-d-announce mailing list