Symbols, Protocols, Frames, and Versioning

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Oct 4 10:06:40 PDT 2012


presumably, looking up "iterator" in a registry of  string/symbol key value pairs.  Creating a new entry if one isn't present, and regardless returning the symbol value associated with the string.

public @iterator = Symbol('iterator');

conceptually could just as easily be expressed as:

public @iterator = RegistryOfWellKnownSymbols.lookup('iterator');

Allen


On Oct 4, 2012, at 10:01 AM, Kevin Smith wrote:

> 
> Dave Herman mentioned another idea: intern'ing strings as symbols. You'd lose uniqueness but avoid colliding with any string. So
> 
>   public @iterator = Symbol.intern('iterator');
> 
> Is this much better than just using 'iterator' or dunder-iterator?
> 
> Apologies, but what would interning a string as a symbol mean?
> 
> Kevin
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121004/ba89ae78/attachment.html>


More information about the es-discuss mailing list