map/filter/reduce/lambda opinions and background unscientificmini-survey

Erik Max Francis max at alcyone.com
Sun Jul 3 20:05:44 EDT 2005


Christopher Subich wrote:

> Interesting; could you post an example of this?  Whenever I try to think 
> of that, I come up with unwieldly syntax for the functional case.  In 
> purely functional code the results of map/filter/etc would probably be 
> directly used as arguments to other functions, which might make the 
> calls longer than I'd consider pretty.  This is especially true with 
> lots of lambda-ing to declare temporary expressions.

I personally think that map looks clearer than a list comprehension for 
a simple function call, e.g.

	map(str, sequence)

vs.

	[str(x) for x in sequence]

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   In Heaven all the interesting people are missing.
   -- Friedrich Nietzsche



More information about the Python-list mailing list