Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by ramen on Wednesday December 02, 2009 @12:32PM
(#972452)
I know you all know this, but I feel like it bears mentioning that nobody is forcing you to use list comprehensions whether map/filter stay in Python's built-ins or not. They can be defined in around 3-4 lines of code each. Lisp aficionados, already accustomed to the bottom-up style of programming, ought to have no problem writing functions like these as necessary.
[ Parent
| on HN ]
Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by holygoat on Wednesday December 02, 2009 @06:50PM
(#973321)
There's a difference between things being possible and being encouraged.
De-emphasizing functional operations makes it more likely for libraries to work in a non-functional style, for tutorials to do so, etc.
It's tiring fighting against a community and a (benevolent) dictator that disagree with you.
Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by riobard on Thursday December 03, 2009 @05:35AM
(#974086)
> It's tiring fighting against a community and a (benevolent) dictator that disagree with you.
That summarizes the problem I guess :D
Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by ricree on Wednesday December 02, 2009 @12:56PM
(#972502)
If I remember correctly, "removing" these functions mostly just meant dumping them into the functools module rather than including them as a built in function.
Re:Why I chose Common Lisp over Python, Ruby, and Clojure
by riobard on Wednesday December 02, 2009 @12:49PM
(#972482)
Yeah I know. Maybe "force" is not the right word ... probably "discourage"?
Actually only one line of code is enough for each of map/filter:
def map(fn, seq): return [fn(each) for each in seq]
def filter(cond: seq): return [each for each in seq if cond(each)]
But seriously, what do you really gain by removing these two? Isn't that too ideological? I don't really see how un-Pythonic it would be to use map/filter instead of list comprehensions. The problem is BDFL's attitude seems to drive many FP-ers away, like the guy in the original post.