Global lexical tier

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Sep 1 05:03:15 UTC 2015


On Aug 31, 2015, at 7:11 PM, Brendan Eich wrote:

> We are in rapid-release hell/heaven.
> 
> This means errata can be issued, and engines can implement the better resolution for those errata, compared to what the last major-version _de jure_ spec mandated.
> 
> Why not?
> 
> /be

The possible semantics of global lexical declarations was extensively explored by TC39 before we make the final design decisions for ES6.  The scoping of global lexical declarations is something we spent many hours discussing  over a span of several years, including: 

https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-07/july-25.md#scoping-rules-for-global-lexical-declaration 
https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-09/sept-19.md#global-scope-revisit 
https://github.com/rwaldron/tc39-notes/blob/master/es6/2013-11/nov-21.md#46-the-global-scope-contour 
https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#45-global-let-shadowing-of-global-object-properties 

plus various es-discuss threads: https://www.google.com/?gws_rd=ssl#q=site:http:%2F%2Fesdiscuss.org+global+let 

There were many issues and alternatives to consider, and we did within TC39.  All of the possible approaches had downsides, but we achieved consensus to proceed with what is now in the spec.

Both the alternative suggest by Jason and the one suggest by Saam were considered and rejected in these discussions. It's easy to imagine a different semantics. It's harder to demonstrate that it is a "better semantics" and to get agreement on that.   If you want to change the ES6 spec you need to explore all of the issues that came in the the documented TC39 discussions and explain why, in light of all those other issues, the ES6 design isn't the best comprise solution to problem with no perfect or easy solution.

Regarding, global declarations in a REPL.  A REPL is a extra-lingual features. In it not covered by the language specification.  A REPL implementation is certainly free to define it's own rules for dealing with the issues that Jason mentioned.  For example, a REPL could allow redefinition of global lexical declaration or it could allow lexical bindings created using the REPL to be deletable.

Allen


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150831/855e58c6/attachment-0001.html>


More information about the es-discuss mailing list