WeakPair primitive ?

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Sep 15 10:47:03 PDT 2011


On Sep 15, 2011, at 10:21 AM, Sean Eagan wrote:

> Would a WeakPair primitive be useful...
> 
> let wp = new WeakPair(key, value);
> ...
> if(wp.hasKey(key)) {
>  foo(wp.value());
> }
> 
> WeakMap could be built on top of this primitive:

It's not that easy.  Read http://www.arnetminer.org/dev.do?m=downloadpdf&url=http://arnetminer.org/pdf/PDFFiles/--g---g-Index1247931776950/Ephemerons A New Finalization Mechanism1247944577286.pdf

You need Ephemeron pairs to build such abstractions

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


More information about the es-discuss mailing list