inconsistency in method removal at redefinition
Created by: reiniervandijk
At this moment gendl only removes old methods (originating from previous object definitions) from the :gdl-slots package. What about removing the associated methods from the :gdl-inputs package?
Try:
(define-object reinier ()
:input-slots
((a 2)))
associated methods can be found with:
(find-method (symbol-function (com.genworks.lisp:intern "a" :gdl-slots)) nil (list (find-class 'reinier)))
(find-method (symbol-function (com.genworks.lisp:intern "a" :gdl-inputs)) nil (list (find-class 'gdl::gdl-basis)
(find-class t)
(find-class 'gdl::gdl-basis)))
Then, when redefining:
(define-object reinier ()
:input-slots
((b 2)))
The gdl-slots methods is removed, however this still returns:
(find-method (symbol-function (com.genworks.lisp:intern "a" :gdl-inputs)) nil (list (find-class 'gdl::gdl-basis)
(find-class t)
(find-class 'gdl::gdl-basis)))
Practically, only the gdl-slots method should be removed to make sure the object doesn't answer messages that it doesn't hold any longer. One could even argue that it's up to the gc system to clean up old method definitions (it doesn't in ACL). However, it is somewhat inconsistent to not clean up the other methods (be lean) and I therefore consider it an issue. Should be noted that the same story applies to gdl-trickle-downs and other packages.
Imported comments:
By genworks on 2013-10-31 23:36:26 UTC
There are reasons for keeping these around.