From: Bruno H. <br...@cl...> - 2004-08-02 11:44:32
|
Notification of dependent objects, as specified in the MOP, doesn't work on generic functions in SBCL 0.8.11. Here's a test case: ;; Check dependents notification on generic functions. (progn (defclass dependent02 () ((history :initform '()))) (defgeneric testgf01 (x)) (defmethod sb-pcl:update-dependent ((gf generic-function) (d dependent02) &rest args) (push args (slot-value d 'history))) (let ((testgf #'testgf01) (dep1 (make-instance 'dependent02)) (dep2 (make-instance 'dependent02)) (dep3 (make-instance 'dependent02))) (sb-pcl:add-dependent testgf dep1) (sb-pcl:add-dependent testgf dep2) (sb-pcl:add-dependent testgf dep3) (sb-pcl:add-dependent testgf dep1) (reinitialize-instance testgf :name 'testgf01-renamed) (defmethod testgf01 ((x integer))) (sb-pcl:remove-dependent testgf dep2) (defmethod testgf01 ((x real))) (remove-method testgf (find-method testgf '() (list (find-class 'integer)))) (mapcar #'(lambda (history) (mapcar #'(lambda (event) (mapcar #'(lambda (x) (if (typep x 'method) (list 'method (mapcar #'class-name (method-specializers x))) x)) event)) history)) (list (reverse (slot-value dep1 'history)) (reverse (slot-value dep2 'history)) (reverse (slot-value dep3 'history)))))) Expected: (((:name testgf01-renamed) (add-method (method (integer))) (add-method (method (real))) (remove-method (method (integer)))) ((:name testgf01-renamed) (add-method (method (integer)))) ((:name testgf01-renamed) (add-method (method (integer))) (add-method (method (real))) (remove-method (method (integer))))) Got: (nil nil nil) Bruno |