shortcut for private(this)

Herby Vojčík herby at mailbox.sk
Fri Jan 20 10:46:11 PST 2012


Brendan Eich wrote:
>> Herby Vojčík <mailto:herby at mailbox.sk>
>> January 20, 2012 10:39 AM
>> Brendan Eich wrote:
>>> And again, we do not want a reified "private state object", so private
>>> could not be a free expression. This also hurts private(other).weight --
>>> 'weight' is not an identifier in a "private state object", it has to be
>>> a private name object binding. Therefore we should avoid any syntax
>>> suggesting a first-class reflection of a private state object.
>>
>> How do I do private(foo)[expression]? Or I don't (yes, it can be
>> worked around by foo. at store[expression], but)?
>
> No problem -- @foo[bar] is the same in abstract syntax as (@foo)[bar].

No, I asked for something else. How do it do: "get a private property of 
<<foo>> whose name is computed by <<expression>>"? Something like 
foo.@[expr]? Or is there no way to do it?
In other words, what is [] syntax for foo. at bar? foo.@["bar"]? foo["@bar"]?

Herby
>
> /be


More information about the es-discuss mailing list