January 19 meeting notes
Andreas Rossberg
rossberg at google.com
Fri Jan 20 05:51:48 PST 2012
A couple of remarks/questions...
On 20 January 2012 01:40, Waldemar Horwat <waldemar at google.com> wrote:
>
> Allen: Do top-level let and const create properties of the global object?
> DaveH (channeling Andreas): No, but functions do.
If that is referring to me then there might have been a
misunderstanding. I don't think I ever suggested making a distinction
between different forms of static bindings. That would be terrible. :)
> Sam: If they don't then the T-shirt Erik is currently wearing wouldn't
> work.
> Many agreed that we can't break the T-shirt.
Let me guess: that T-shirt is saying "let is the new var"?
> DaveH: What if there are duplicate top-level bindings?
> MarkM: Top-level let should behave as much as possible the same as
> concatenated scripts.
There are some serious issues lurking here. I would like to float
another idea for reforming the top-level, but I'll do so in a separate
post.
> Also, "function (e) {let e;}" should always be an error.
Is there a good reason to do this? It would be an unnecessary
irregularity with block scoping, and seems like overly nanny-ish (in
stark contrast to other parts of the language).
> Discussion about scope of for-bindings.
> for (var x = ...;;) {...} will, of course, retain ES1 semantics.
> for (let x = ...;;) {...}
> Allen: This will behave as in C++: x is bound once in a new scope
> immediately surrounding just the for statement.
> DaveH: Strangely enough, this creates a new x binding in Dart at each
> iteration.
Why strange?
> [...]
> Those opposed earlier to new-binding-per-iteration hop back onto the fence.
> Waldemar, Brendan, and DaveH hop off the fence to now support it, as it will
> cure an annoying gotcha in practice. Looks like we have support for it now.
I'm happy to hear that. Given lexical closures, I think it clearly is
the far superior semantics. Just need to get the V8 implementation in
line...
/Andreas
More information about the es-discuss
mailing list