On Jul 15, 2013, at 6:49 AM, Jeremy Martin wrote:

> 
> In some (most?) cases, but not all.  There's already a consensus that the 
> garbage collection semantics of WeakMaps aren't always appropriate [2].  By 
> parameterizing the Symbol constructor, developers can create custom map/set 
> types without the overhead of a "Symbol Factory" (as previously suggested by 
> Allen).  I believe this would be a useful building block for interesting and 
> innovative custom types.
> 
> [1]: https://en.wikipedia.org/wiki/Injective_function#Definition
> [2]: http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets

An implementation of your proposal is going to have to have to internally use  
some wort of weak-keyed table, in practice an implementation would probably use 
the same GC mechanisms that are there to support WeakMap.  So, I doubt there 
would be much performance difference between a built-in and a roll-your-own 
implementation. 

Allen

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to