i'm a newbie to Common Lisp and developing a small game engine where i want to implement the signal-slot concept of Qt. basically it means that you can specify "signals" and "slots" (not Lisp slots) for classes and connect them for some instances. everytime the signal is called the connected slots are also called. please could you give me some hints on how to do this. i would really appreciate it!
example:
Code: Select all
(defclass A ()
((foo :accessor foo))
(:signals (setf foo)))
(defclass B ()
((bar :accessor bar))
(:slots (bar)))
(connect a1 (setf foo) b1 (setf bar))
(connect a1 (setf foo) b2 (setf bar))
(setf (foo a1) 537) ; => b1.bar and b2.bar = 537