Speaking of Lisp...

Peter Hall peterjoel at gmail.com
Fri Jan 5 18:33:11 PST 2007


While identifiers can be QNames, does that automatically mean that
it's useful to use QNames for hash keys? Probably not.

But, even so, I don't see a big barrier if qualified keys were
required. For QNames with non-empty namespace URI, there would be no
pollution problem and for unqualified keys you could add a prefix to
prevent collision with Object.prototype.

Something like AS3's Proxy object would mean you could encanpsulate
that implementation quite cleanly too. I'd prefer to see AS3's Proxy
and Dictionary classes added to ES4 before more strange syntax - ES4
is already filling up with a lot of new notations and concepts, that
would be unfamiliar and difficult to many existing JS/AS developers.

Peter

On 1/6/07, Brendan Eich <brendan at mozilla.org> wrote:
> On Jan 5, 2007, at 5:01 PM, Jeff Thompson wrote:
>
> > Since Firefox 2.0, they fixed the following bug, so that == on two
> > strings instantly checks
> > for two identical string objects.
> > https://bugzilla.mozilla.org/show_bug.cgi?id=314890
>
> That's just an optimization, since == is defined to compute true for
> any two strings with the same ordered list of characters.
>
> ECMA TG1 has not considered symbols.  Macros and property quotation
> facilities have been mentioned for post-ES4 work, so who knows?
>
> Another item falling out of the ES4 spec: hashes mapping string to
> value where the mapping is not polluted by Object.prototype.  A late
> "save" may be possible, if anyone can suggest syntax.  E.g., var hash
> = #{'foo':1, 'bar':2, 'baz':3}; alert('toString' in hash) => false.
> Eek, yet another attempt to use #.
>
> (Should these map value to value, rather than string to value?  E4X
> (ECMA 357) already introduced QName objects as identifiers, so one
> can't pretend all properties are named by strings, if one believes in
> E4X.)
>
> /be
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss
>



More information about the Es4-discuss mailing list