Security Demands Simplicity (was: Private Slots)

Brendan Eich brendan at
Fri Jan 18 01:25:45 PST 2013

Domenic Denicola wrote:
> If we’re making up new syntax, I think this would be much nicer if 
> “private.x” were spelled “this. at x” and “private(x)” were spelled “x.@”

+1 and this is not a minor point.

> Also, I don’t see why constructors need to use the “private.x” syntax 
> whereas other methods get to use the free variable?

+2 -- Same here, only moreso!

This thread goes over ground well-trod in 2011:

and others -- search for "private data record" 2011 es-discuss

> With these in mind I give the following fork: 

Kevin, could you do an alterna-gist as Domenic proposes? Of course 
there's much more at stake than syntax, but it would help.

> *From:*es-discuss-bounces at 
> [mailto:es-discuss-bounces at] *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).
> Thoughts?
> { Kevin }

More information about the es-discuss mailing list