I was wondering if the one-block limit bothered anyone else. Maybe something like Haskell's where clause:
map(foo, pairs) where:
pairs = [(0,1), (20, 10), (30, 10)]
def foo(pair):
a = pair[1] * 2
b = pair[0] * a
return (b, a)
I'm not terribly familiar with Python's grammar, so it might be difficult to introduce a closing where-clause without ambiguity. In that case, it might be useful to use a do clause as well: do:
<statements>
where:
<statements>
Another alternative would be to simply create a real function literal syntax (i.e., lambda that doesn't suck).