shortcuts for defining block-local private names, plays nicely with @foo syntax

Gavin Barraclough barraclough at apple.com
Mon Jan 23 13:22:47 PST 2012


On Jan 23, 2012, at 1:11 PM, Brendan Eich wrote:
> Then I think we considered a proposal where private x; bound in a separate lexical chain but that chain was searched *only* on right of @. That proposal seemed not to have the readability drawback. It also solves the problem you show above?

Ah, that's the detail that I'd missed! - if private names will be ignored if they are not to the right of @, then presumably my example *would* result in at least a reference error, since 'x' would not in scope in 'getX' (unless of course x resolves to the global object...).  I was wrong in thinking that getX would return the private name? – if so, this sounds good to me!

Do we want there to be a way to be able to get to a private name object declared by 'private foo;' syntax, or if developers want to get their hands on a private name objects that they can pass around should they just be calling Name.create directly?

cheers,
G.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120123/5aa456e5/attachment.html>


More information about the es-discuss mailing list