Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I unintern a qualified method?

During development I defined an 'initialize-instance :after' method which after a while was not needed anymore and actually gets in my way because inside it calls code that is not valid anymore. Since the unintern function does not have an argument for the qualifier, is there any way I can "unintern" the symbol-qualifier combination of a method so that I don't have to slime-restart-inferior-lisp and load the project again from the start?

like image 381
Paralife Avatar asked May 12 '11 10:05

Paralife


2 Answers

You can use the standard functions find-method and remove-method to do it:

(remove-method (find-method #'frob '(:before) '(vehicle t)))

I find it's much easier to use the slime inspector. If your function is named frob, you can use M-x slime-inspect #'frob RET to see a list of all methods on frob and select individual methods for removal.

like image 52
Xach Avatar answered Nov 02 '22 17:11

Xach


See the answer from Xach.

Methods are collected in generic functions. UNINTERN has nothing to do with that. What you want is to remove a method from a generic function.

Most Common Lisp IDEs have a way to do that. Either via the editor (M-x undefine...) or through some inspector tool.

like image 5
Rainer Joswig Avatar answered Nov 02 '22 17:11

Rainer Joswig