shortcut for private(this)

Herby Vojčík herby at
Fri Jan 20 11:55:11 PST 2012

Erik Arvidsson wrote:
> let object = ...
> {
>    let key = Name.create()
>    let secret = {}
>    object. at key = secret
> }

Oh, so all that foo. at bar does is to have different syntax for foo[bar], 
bar being private name? Than it's not as cool as I thought at all.

private keyword in class proposal did something a lot more convenient. 
It created private name behind the scenes and let people to use 
"private" properties with doing
   prvKeyA = Name.create();
   prvKeyB = Name.create();
for all private keys they wanted to use. This was _the_ purpose of 
private keyword.

It seems I was overjoyed prematurely... :-/


P.S.: Why not to let obj[privateName]? It is fine.

More information about the es-discuss mailing list