@name

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Mar 15 09:03:55 PDT 2012


On Mar 15, 2012, at 7:30 AM, Kevin Smith wrote:

> Hi Allen,
> 
> In this stawman, private members are accessed using obj.name, where "name" can be a private name that is in scope.  Why was this strategy abandoned?
> 
> kevin

There was significant negative feedback on this list WRT that version of the proposal.

See the long thread starting at https://mail.mozilla.org/pipermail/es-discuss/2010-December/012299.html and other related threads in December 2010.

It would probably be a good idea for me to go back and re-read all of those threads, but main recollection of the main issues were:

1.  Many people believed that the parallel name spaces for variables and private names was too confusing:

private x;  //declare x as a private name     
function (p,x) {  //declare x as a parameter, it does not shadow private name x
   p.x = x;             // .x resolved using private name scoping, RHS x resolved using normal declaration scoping
}
        

2. Many people (not necessarily the same people in all cases) did not like the fact that the existing identify:

     obj.name
is always equivalent to:
     obj["name"]

was lost. 

There did not appear to be any chance of consensus forming around this proposal so backed of to the current, much simpler private name proposal that does not have a |private| declaration (and hence introduces no new scoping issues) and which only supports obj[nameValuedExpression] as a syntax for accessing private named properties. The idea was to make the proposal as simple as possible so we could get agreement on it.

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120315/b05e4d3f/attachment.html>


More information about the es-discuss mailing list