New private names proposal [repost]

David Herman dherman at mozilla.com
Wed Dec 22 00:51:09 PST 2010


On Dec 21, 2010, at 10:41 PM, David-Sarah Hopwood wrote:

> Again you seem to be confusing the "inherited soft fields" proposal with
> the *separate* proposal on desugaring the private name syntax to inherited
> soft fields.

I think I may have been misunderstanding what Mark was actually proposing/advocating, then. I'm happy to be disabused of my mis-reading.

But on re-reading, I still can't quite make sense of the "Can we subsume Names?" section. There are two syntactic components to the private names proposal:

(1) the bracket-notation is generalized to recognize private name values to look for private properties

(2) the dot-notation and colon-notation are generalized to use private names when their property name is bound by a |private| declaration

But the "Can we subsume Names?" subsection seems to mix these two cases up. To match up with (1), you'd need to interpret *all* bracket notation as a potential lookup of a soft field, i.e. something like:

    e1[e2] ~~>
        let (t1 = e1, t2 = e2) {
            => t2 instanceof SoftField
             ? t2.get(t1)
             : t1[t2]
        }

(where the rewritten brackets are the "true" brackets, i.e., not re-desugared).

Dave



More information about the es-discuss mailing list