return when desugaring to closures

Mark S. Miller erights at google.com
Sat Oct 11 15:38:32 PDT 2008


On Sat, Oct 11, 2008 at 3:25 PM, Jon Zeppieri <jaz at bu.edu> wrote:
> [...]  I'd just like a
> non-hoisting 'let.'  Based on what you wrote about hoisting earlier in
> this thread, I'm surprised you don't want one, too.

History aside, my preference would be what E does: A variable is in
scope textually starting at the point of declaration, left-to-right,
until the close of its enclosing scope block. I would love it if this
applied to lets, consts, and functions. However, given that ES3
functions hoist (within the top-level function body), I think the
least surprising least asymmetric compromise is to generalize
functions to be per-block, and to have const and let scope like
functions will.

-- 
    Cheers,
    --MarkM


More information about the Es-discuss mailing list