Signals and Slots in D

Josh Stern josh_usenet at phadd.net
Fri Sep 29 09:02:35 PDT 2006


On Fri, 29 Sep 2006 16:40:09 +0900, Bill Baxter wrote:


> I think railroading Qt's S&S into a language is the wrong approach. 
> What goes into the language should be a more general mechanism on top of 
> which schemes like dynamic S&S can be easily built.

Yeah, I was thinking this also the other day when talking about "hooks".

To be more concrete, I think it would be a great feature to allow 
some of the hooking that modern debuggers do - e.g. from now on execute
this bit of code at entry or exit of a given function.   In the context
of S&S as discussed in this thread, such functionality could allow
already written functions to start being used as either signals or slots
without requiring source code modifications to their definition.   Signals
would be created by some library that hooks the end of the emitting
function and the GC issue could be solved by hooking the destruction of an
object (searching based on its address).

Undoubtably there would be many other cool options and a lot of synergies
with the unit testing functionality for debugging.








More information about the Digitalmars-d mailing list