Signals and Slots in D

Walter Bright newshound at digitalmars.com
Thu Sep 28 18:59:48 PDT 2006


Lutger wrote:
> Almost, it's very simple, like the plain old function pointer as 
> callback in C. The main difference is:
> - when an object which has member functions connected gets detroyed, 
> there is no problem, no segfaults.

Doesn't garbage collection automatically take care of that?

> - signals and slots are not as tightly coupled to a specific class as in 
> your example. Be it through introspection or ifti, class B needs to know 
> nothing about A except where it can connect, meaning more less coupling 
> between classes. I think thats all there is to it in essence.

I think that is easily handled with a naming convention - call A.connect().



More information about the Digitalmars-d mailing list