Global lexical tier
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?
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:
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss