質問

I've made a mistake and forgot to specify keyword arguments in defgeneric the first time I've compiled it. Now I really don't want to restart SLIME only to redefine this one defgeneric to include more arguments. Is there a way to "undefine" it somehow?

Oh, sorry, never mind, after removing all methods defined for that generic, SBCL redefined it, so it's all good now:

(remove-method #'some-generic 
  (find-method #'some-generic '() (list of method types)))

For posterity.

役に立ちましたか?

解決

See fmakunbound.

(fmakunbound 'some-generic)

他のヒント

SLIME has the command Ctrl-c Ctrl-u to undefine a function. Set the cursor on the function symbol and then type the sequence.

Another possibility would be to compile one or more methods with the additional arguments and then, after your Common Lisp implementation "complains" about the unknown parameters, select the restart which updates the arguments available in the generic function.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top