On Thu, Sep 9, 2010 at 10:08 AM, Tom Van Cutsem <[email protected]> wrote:
> However, I wonder if it would be possible to get the best of both worlds.
> IIUC, the Names proposal converts:
> private x;
> this.x = "foo";
> this.x
>
> into:
> let x = new Name;
> this[x] = "foo";
> this[x]
> Would it be possible to instead rewrite it to:
> let x = new ExplicitSoftField();
> x.set(this, "foo");
> x.get(this)
> (using the same rules for determining the scope of 'x' as detailed in the
> Names proposal)
> You would get the 'private' scoping of Names, and the concise syntax,
> without the limitations that MarkM raised. Am I missing something?
I don't think this will work with more sophisticated uses of names,
where 'private' isn't used. For example, this function:
function lookup(obj,key) {
return obj[key];
}
won't work properly without Names as real values.
--
sam th
[email protected]
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss