Lazy list/range comprehensions

bearophile bearophileHUGS at lycos.com
Sun Oct 3 11:09:39 PDT 2010


Jérôme M. Berger:

> 	Why didn't you write the second like this to keep it functional:
> result2 = dict (map (lambda x: (x, x*x), xrange (20)))

Because I've never seen people write it that way, and because for me it's less readable than the normal imperative code.

Bye,
bearophile


More information about the Digitalmars-d mailing list