Ducks, Rabbits, and Privacy

Dean Landolt dean at deanlandolt.com
Tue Jan 22 10:29:38 PST 2013


On Tue, Jan 22, 2013 at 11:13 AM, Brandon Benvie
<brandon at brandonbenvie.com>wrote:

> I also agree with everything that Nathan said.
>
> To clarify, there's Symbols and then there's private Symbols. I don't
> think anyone in TC39 is suggesting the removal of Symbols in general.
> Private Symbols have a much more specific set of uses cases than do just
> Symbols in general, and regular Symbols will accomplish the goal of
> encapsulation.
>

No, symbols accomplish the goal of stratification [1] (I've used this
terminology in the past and was corrected but from a mathematical logic
standpoint this property is precisely what symbols give us). Unique symbols
fail as a means of encapsulation -- and this is whole point of private
symbols.


>  Regular symbols are only enumerated by a new ES6 function and are unique.
> Currently, the only difference between a normal symbol and a private Symbol
> is that private symbols are not enumerated by getOwnKeys and they are
> slated to eventually be awkward to use with proxies. Otherwise a normal
> (aka Unique) Symbol works exactly the same.
>

You're awkwardly (and derisively) describing what could more concisely be
called "encapsulation". This is the difference between unique and private
symbols, as Nathan expressed beautifully.

[1] http://en.wikipedia.org/wiki/Stratification_%28mathematics%29
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130122/0cd8ff06/attachment.html>


More information about the es-discuss mailing list