Hacker News new | past | comments | ask | show | jobs | submit login

I love writing python, but the lack of decent map/reduce/etc. (that are really good in Javascript - the other language I mainly write) hurts. Stuff like your example really feels burdensome and inelegant in comparison.



Python list comprehensions _are_ map/reduce.


I think you mean map/filter.


Yes, thanks for correcting me.


Sure, but they compose really bad.


Why? Just assign to a variable, then do another list comprehension on the next line, no?


And that is a pretty sad state of affairs compared to ways that do compose well, like the one in Ruby which you can easily chain.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: