Re: map/filter/reduce/lambda opinions and background unscientificmini-survey
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

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

From: Erik Max Francis <max@alcyone.com>
Date: Mon Jul 04 2005 - 02:05:44 CEST

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@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
Received on Thu Sep 29 16:44:12 2005