Leslie P. Polzer wrote:
>> How can I change the parameter list of a defmethod (defgeneric)
>> without restarting sbcl?
>>
>> I tried fmakunbound etc., without success.
>
> Perhaps you need to try again?
>
> CL-USER(1): (defmethod foo (a b))
> STYLE-WARNING: Implicitly creating new generic function FOO.
>
> #<STANDARD-METHOD FOO (T T) {AC87929}>
> CL-USER(2): (defmethod foo (a b c))
>
> debugger invoked on a SB-PCL::FIND-METHOD-LENGTH-MISMATCH in thread #<THREAD "initial
> thread" {A725541}>:
> The generic function #<STANDARD-GENERIC-FUNCTION FOO (1)> takes 2 required
> arguments; was asked to find a method with specializers
> (#<BUILT-IN-CLASS T> #<BUILT-IN-CLASS T> #<BUILT-IN-CLASS T>)
> See also:
> The ANSI Standard, Function FIND-METHOD
>
> Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
>
> restarts (invokable by number or by possibly-abbreviated name):
> 0: [ABORT] Exit debugger, returning to top level.
>
> (SB-PCL::REAL-GET-METHOD
> #<STANDARD-GENERIC-FUNCTION FOO (1)>
> NIL
> (#<BUILT-IN-CLASS T> #<BUILT-IN-CLASS T> #<BUILT-IN-CLASS T>)
> NIL
> T)
> 0] (fmakunbound 'foo)
>
> FOO
> 0] 0
>
> CL-USER(3): (defmethod foo (a b c))
> STYLE-WARNING: Implicitly creating new generic function FOO.
>
> #<STANDARD-METHOD FOO (T T T) {ACE3731}>
>
> Doesn't that work for you?
>
Yes, it works, thanks.
I always tried (fmakunbound #'foo)
and got that .... fell through ETYPECASE expression.
Thanks, Helmut
|