Is there any plans to make working signals in D?

Robert jfanatiker at gmx.at
Mon Apr 15 02:07:33 PDT 2013


> 2. Make regular D objects on closures [4] to be able to know when 
> delegate's outer scope is destroyed (this will auto-fix both [5] and 
> [2], see Comment 2 of [2] for code example)

I still don't understand what that buys us. Having a closure being an
object would make it possible to use a weak reference, but why would you
want that? The signal would be the only one to hold a reference to the
lamdas context, if this reference was a weak one, then the memory would
be claimed immediately. This is why std.signals2 holds a strong ref to
the delegate context of a wrapping closure and a weak ref to the target
object.





More information about the Digitalmars-d mailing list