Proposal: opt-out local scoping

Dave Herman dherman at ccs.neu.edu
Thu Aug 28 06:09:12 PDT 2008


> I like this, but wouldn't you want to provide escapes, like "reformed 
> with" and/or a way to declare an individual reference to be free?

Reformed `with' depended on type annotations and structural type syntax, 
which are undergoing discussion. So I think reformed `with' is up in the 
air for now.

As for free references, what can you do with a free variable? If you 
mean you want a way to look something up in the global object, then use 
`this.id' or `this[expr]' (or `let global = this' followed by 
global.id/global[expr]).

It might be nice to have a standard library (called `global' or 
something) that's bound to the global object so you can have a less 
fragile binding to the global object than `this'.

Dave


More information about the Es-discuss mailing list