[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Redefining before and af
- To: "Rodney Daughtrey" <rodney%proact@uunet.UU.NET>, "Shannon V Spires" <uunet!somnet.sandia.gov!svspire@uunet.UU.NET>
- Subject: Re: Redefining before and af
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Sun, 20 Mar 1994 17:56:05 -0600
- Cc: "MCL list" <info-mcl@cambridge.apple.com>
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
'(:before)
(list (find-class 'tarzan)
(find-class 'jane)
(find-class t))
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.