문제

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