From: Clinton Hyde
Subject: Re: punting a method.
Date: 
Message-ID: <CHYDE.92Aug11160002@pecos.ads.com>
well, as many have pointed out, it's easy. find-method wants a list of
class-objects, not types.

so here's a much more fun version of how to get rid of a method, in
which you just provide names of things:


(defun undefmethod (gen-fn-name qualifiers-list specializer-type-names-list)
  "This will remove a method from a generic function. Only names are required.
Qualifiers-list is a list of things like :after, :before, :around."
  (let (meth
	(gen-fn (ensure-generic-function gen-fn-name)))
    (unless gen-fn
      (error "There is no generic function named ~S" gen-fn-name))
    (setq meth (find-method gen-fn qualifiers-list (mapcar #'find-class specializer-type-names-list)))
    (unless meth 
      (error "There is no method for ~S with Qualifiers ~S and specializer-classes ~S"
	     gen-fn-name qualifiers-list specializer-type-names-list))
    (remove-method gen-fn meth)))


usage is

(undefmethod 'method-name quals-list specializers-type-list)

for specializers-type-list, it's something like:

(list t 'type1 'type2 ...)

only tested in Allegro CL 4.1, but it appears to be just plain CLOS
stuff, as advertised in CLtL2...

 -- clint
--

Clint Hyde		"Give me a LispM or give me death!" -- anonymous

Advanced Decision Systems	Internet:  ·····@chesapeake.ads.com
2111 Wilson Blvd #800
Arlington, VA 22201		(703) 875-0327