Groovy has nice syntax for simple clojures, which eliminates the need to explitly name the single parameter. It will be named it by default.
def closure = { print it }
closure( "hi there" ) //prints "hi there"
What is the best way to emulate it magikal parameter in Python?
Example of what I want:
>>> it = It()
>>> print map(it + 5, [1, 2, 3])
[6, 7, 8]
So far I have found the exact anwser on my question. This is the library fn.py which implements _ magikal variable and some usable functional programming conceptions.
Example of use: