new strawman: syntactic support for private names

Herby Vojčík herby at mailbox.sk
Wed Aug 29 04:23:32 PDT 2012


Hello.

Two things.

1. If keyword "private" is used for defining the private names (so it is 
already "used"), why not to use reserved word "public" to define unique 
names?

2. As for protected scoping issues (though I do not like it, since it 
makes classes more heavy by looking for @protectedBindings), I would 
vote for the last proposal, that is, explicitly "import" protected name 
into class' scope. But the "if there is an inherited, use it, otherwise 
create new" is tricky, your example shows why: you call super. at validate 
there. If there wasn't any super @validate, the code breaks.

So for this case, I'd propose not only "protected @foo;" as a means of 
"use inherited, if none, create your own", but also "protected super 
@foo;" (or even only "super @foo;", eventually making "super @foo;" 
silently assume "protected " before itself) as a means of "use 
inherited, if none, fail".

Herby

Allen Wirfs-Brock wrote:
> The strawman is at
> http://wiki.ecmascript.org/doku.php?id=strawman:syntactic_support_for_private_names
>
>
> Allen
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list