return when desugaring to closures
dherman at ccs.neu.edu
Sat Oct 11 12:55:30 PDT 2008
> How to define a variable that is local to the enclosing lambda? Isn't
> the ability to do that essential?
No. With all due respect to Brendan, `var' hoisting to the top of a function body is one of the more problematic aspects of ES's semantics. If you want a local variable, use `let' -- it'll be local to its containing block. If you want a variable that is local to the entire body of a `lambda', use `let' at the top level of the `lambda' body.
More information about the Es-discuss