Reducers, transducers and core.async in Clojure
Disclaimer: as a Clojure developer and functional programming evangelist, I do not want to be too critical of this article. It's a really great post about some incredibly valuable and advanced Clojure features.<p>That being said, it really bothers me when functional programming evangelists write out such horrible Python code examples. It makes Python look like it's <i>not</i> a functional language. It perpetuates the idea that Python won't let you write elegant and stateless programs that behave in a functional manner.<p>If the author had not mentioned Python and had instead used it  as pseudocode to represent the entirely non-functional way to write something, I would have been okay with it. But calling out Python specifically is just incorrect!<p>I have rewritten the code in a very pythonic manner that illustrates the functional capabilities of the language:<p><pre><code>    even = lambda x: x % 2 == 0

    # alternatively, depending on your religious beliefs:
    def even(x): return x % 2 == 0

    def process(seq):
      return sum(x + 1 for x in seq if even(x))
</code></pre>
Note the (parens) for the comprehension instead of [brackets], which creates a generator. The above code is lazy (in Python 3)!<p>And if we fire up a python repl and play around:<p><pre><code>    In [2]: process(range(10))
    Out[2]: 25
</code></pre>
I really love Clojure and use it daily, but I find the Python version to be far more legible. It reads more like english.<p>Anyway, the moral of the story here is that you can do immutable/functional programming with regular ol' Python.