Symbols, Protocols, Frames, and Versioning

Kevin Smith khs4473 at
Wed Oct 3 12:40:55 PDT 2012

> So should there be a way in the language to create singleton symbols? If
> so, how?

    new Symbol("21fef4ae-1439-4b6a-b412-3585906b35f1");

: ) Joking, of course.

Seriously though, in order to specify a singleton symbol in user code,
you'd have to give the system enough information to be able to identify
other occurrences of such a symbol in the multi-global environment.  So in
effect, you'd have to supply the system with a globally unique identifier.
 Ergo, we've travelled right back around to maintaining a global namespace.
 "org.ecmascript.system.iterator", anyone?  ; )

You could say that the URL of the script where the symbol is defined forms
the basis of such a unique identifier, but we'd still have to worry about
multiple copies of the same script (or perhaps different versions) located
at different URLs.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list