Weak event listener

David Bruant bruant.d at gmail.com
Wed Apr 3 13:10:39 PDT 2013


Le 03/04/2013 21:18, Mark S. Miller a écrit :
>
>     Do languages which added WeakRefs have a form of revokable
>     reference too? What difference would it make?
>
>
> E has both. In practice, my sense is that their use cases are 
> disjoint, and that both are needed.
Do you have examples of use? May be links to E code.

In what way is the GC-notification mechanism really necessary? (that's 
the part that I'm personally annoyed with most).
I would be much less bothered if weakrefs were in essence revocable 
references for which only the GC has the revoke function (called on GC 
of the underlying target).
It seems it would already solve the use cases exposed on the list which 
(my summary) Kevin expressed as "A core part of the problem here is that 
the distinction between an 'important' reference - one that must keep an 
object alive - and an 'incidental' reference, that only need exist as 
long as it target does"

Whatever final form is chosen (and even if weakrefs are only for ES7), 
would it make sense to unify what a revoked proxy and a dead weakref 
look like?
Both look very close in what they are.

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


More information about the es-discuss mailing list