www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Poor Java

This shows how much some poor Java programmers today feel the need for a bit
more functional-programming in their language:
http://jedi.codehaus.org/Examples
But they are going to fail.

That page also shows why array/lazy comprehensions will be a very good thing to
add to D (I'm waiting for an answer from Walter about this topic still):
http://en.wikipedia.org/wiki/List_comprehension

Just to note that it's not something used by a single exotic language, I can
list some of the growing number of languages that today support them (usually
in not lazy way): Haskell, Erlang, Python (and derived languages like Boo,
Cobra, maybe Wirbel, etc), Scala, F#, Visual Prolog, C#, Clojure, JavaScript.

(In that Wikipedia page you can also see that while several languages support
them, the syntax used by Python is by far the best).

Lazy generator expressions can also be used inside associative arrays.

Bye,
bearophile
Dec 13 2008