Re:JavaScript Needs Blocks
by spacemanaki on Tuesday January 10, 2012 @01:45PM
(#3448316)
Technically Python has what I like to call "Java closures" (although I admit that is not really fair). In Python the body of an anonymous function (lambda) can only be an expression and the bindings closed over by a named inner function are immutable. You can get around the second limitation with a single element list and this is the same way you get around Java's limitation that a local variable referenced by an anonymous inner class be final.
[ Parent
| on HN ]