WeakMaps question ?

Allen Wirfs-Brock allen at wirfs-brock.com
Sat Nov 12 09:19:48 PST 2011

On Nov 12, 2011, at 5:10 AM, Russell Leggett wrote:
> Regardless of the implementation of primitive values, couldn't we say that the semantics of a weak map ignore primitive keys and look only at the value. Primitive keys are exceptionally common for maps, and this would open up a lot of potential uses, especially regarding caching.

What you are asking for is a "weak array" (or an array of "weak references").  While some people think that such things have utility others are concerned that they expose GC based non-determination which they don't want to allow into the language.


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

More information about the es-discuss mailing list