home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.lisp
- Path: sparky!uunet!decwrl!parc!gregor
- From: gregor@parc.xerox.com (Gregor Kiczales)
- Subject: Re: having a tiny prob with CLOS
- In-Reply-To: chyde@pecos.ads.com's message of 10 Aug 92 20:03:55 GMT
- Message-ID: <GREGOR.92Aug12133951@tracer-bullet.parc.xerox.com>
- Sender: news@parc.xerox.com
- Organization: Xerox Palo Alto Research Center
- References: <cyen.713460550@ponder> <CHYDE.92Aug10150355@pecos.ads.com>
- Date: 12 Aug 92 13:39:51
- Lines: 36
-
- In article <CHYDE.92Aug10150355@pecos.ads.com> chyde@pecos.ads.com (Clinton Hyde) writes:
-
- From: chyde@pecos.ads.com (Clinton Hyde)
- Date: 10 Aug 92 20:03:55 GMT
-
- i have a method I want to remove. to do so, I need to find it with
- find-method, but i haven't been able to figure out what FIND-METHOD
- really wants as args.
-
- (find-method (ensure-generic-function my-method-name) NIL '(t))
-
- but this doesn't work.
-
- The specializers have to be "specializers" not "specializer names." The
- AMOP makes this distinction more clear than it is in CLtLII. So, you can
- fix this case by saying:
-
- (find-method #'foo
- ()
- (mapcar #'find-class '(t)))
-
-
- Another way that is often much easier, especially in the common case
- where there are only a few methods on the generic function, is to grovel
- through the result of GENERIC-FUNCTION-METHODS. Like this:
-
- (defmethod f1 ((x foo)) ..)
- #<Method F1 (FOO) ..>
- (defmethod f1 ((x bar)) ..)
- #<Method F1 (BAR) ..>
-
- (generic-function-methods #'f1)
- (#<Method F1 (BAR) ..> #<Method F1 (FOO) ..>)
-
- (remove-method #'f1 (cadr *)) ; this removes the method specialized to FOO
-
-