If we’re making up new syntax, I think this would be much nicer if “private.x” were spelled “this.@x” and “private(x)” were spelled “x.@”
Also, I don’t see why constructors need to use the “private.x” syntax whereas other methods get to use the free variable? With these in mind I give the following fork: https://gist.github.com/4562796 From: es-discuss-boun...@mozilla.org [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Kevin Smith Sent: Thursday, January 17, 2013 21:40 To: Mark S. Miller Cc: Brendan Eich; es-discuss Subject: Re: Security Demands Simplicity (was: Private Slots) It seems as if this approach to private class members also allows us to describe private methods in a convenient way. Private methods can be attached to the _prototype_ of the private field object, thus avoiding per-instance allocation. Of course, the correct "this" value has to be used in the expansion when calling the private method, but this approach appears to be compatible with mixins (whereas private symbols are not). https://gist.github.com/4561871 Thoughts? { Kevin }
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss