functional vs procedural list comprehension

Skip Montanaro skip at pobox.com
Sun Sep 9 09:21:57 EDT 2001


    Guido> Someone remarked that the functional behavior would be easier to
    Guido> understand; I think that's only true if you know a whole lot
    Guido> about compilers and functional languages.

List comprehensions mimic current for loops almost exactly.  That makes them
easier to explain to people who already use for loops, which is almost
everyone.  You never have to befuddle people (especially non-CS types) with
the terms "functional" or "procedural".

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list