[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redefining before and af

At  1:18 PM 3/18/94 -0600, Rodney Daughtrey wrote:
>Another way to do this which doesn't require Mark's clos-inspector-hacks: if the
>method you wanted to remove was
>(defmethod foo :before ((me tarzan) (you jane) a-monkey))
>	...)
>you could execute
>(ccl::remove-method #'foo (list :before (list (find-class 'tarzan) (find-class
>'jane) t)))

You forgot to say FIND-METHOD, and you forgot a specializer for
the third argument to FOO.  Also, REMOVE-METHOD is exported from the
Common-Lisp package, so you don't need the package qualifier:

(remove-method #'foo (find-method #'foo
                                  (list (find-class 'tarzan)
                                        (find-class 'jane)
                                        (find-class t))

MCL has a METHOD macro that makes this a bit easier to type.:

(remove-method #'foo (method foo :before (tarzan jane)))

If you don't mind using undocumented internals:

(ccl::%remove-method (method foo :before (tarzan jane t)))

I usually evaluate the definition that I'm about to nuke in
its Fred window, then go to the listener and say:

(ccl::%remove-method *)

Then nuke it from its Fred window.