[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: >Getting rid of methods
- To: derek@cambridge.apple.com (derek)
- Subject: Re: >Getting rid of methods
- From: Laura_Bagnall@TERC.edu (Laura Bagnall)
- Date: Wed, 22 Jul 1992 11:55:25 EST
- Cc: info-mcl@cambridge.apple.com (info-mcl)
- Organization: TERC, 2067 Mass. Ave., Cambridge, MA, 02140
Reply to: RE>>Getting rid of methods
>> Derek White asks:
>> Has someone written a function that "undoes" the effect of a definition?
This method when given either a generic function, or a symbol which is the
name of a generic function, puts up a dialog with a list of all methods of
that generic function, and removes the method you choose from the list.
(defun undefine-method (generic-function)
(setf generic-function (if (symbolp generic-function)
(fdefinition generic-function)
generic-function))
(if (not (typep generic-function 'generic-function))
(format t "~%~A is not a generic function." generic-function)
(let ((method-to-be-removed
(car (select-item-from-list
(generic-function-methods generic-function)
:window-title "Select a method to be removed"))))
(when (y-or-n-dialog
(format nil "OK to remove ~A?" method-to-be-removed))
(remove-method generic-function method-to-be-removed)
(format t "~%~A removed." method-to-be-removed)))))