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

Christopher Subich spam.csubich+block at block.subich.spam.com
Sun Jul 3 19:17:23 EDT 2005


Carl Banks wrote:
> 
> Christopher Subich wrote:
>>I've heard this said a couple times now -- how can listcomps not
>>completely replace map and filter?
> If you're doing heavy functional programming, listcomps are
> tremendously unwieldy compared to map et al.

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.



More information about the Python-list mailing list