To be honest that Python list comprehension is really hard for me to internalize.
I find Ruby way much more natural.
xx.select { |x| bar(x) }
Even Clojure is better
(filter (fn[x](bar x)) xx)
or
(filter #(bar %) xx)
I find Ruby way much more natural.
xx.select { |x| bar(x) }
Even Clojure is better
(filter (fn[x](bar x)) xx)
or
(filter #(bar %) xx)
That said, in Python, you have to take what you can get, though. And generally I expect more people are familiar with Python than Haskell. Probably I should've used Ruby. Oh well.
filter foo xx
Four spaces: filter foo xx