我可以在Common Lisp中取消调用函数

4 emacs function common-lisp

我正在学习defclassdefmethoddefgeneric,所以我做了一个defclasssavings-account与成员balance.

我创建了一个defun(如下所示)开始改变平衡值,但它还没有完成.

(defun balance (account)
  (slot-value account 'balance))
Run Code Online (Sandbox Code Playgroud)

然后我决定defgeneric改用(下面).

(defgeneric balance (account))
Run Code Online (Sandbox Code Playgroud)

但是当我运行时,defgeneric我收到了这个错误:

BALANCE已经命名了普通函数或宏.

有没有办法轻松取消调用或取消平衡,所以我不必重启我的Emacs会话?

Xac*_*ach 6

您可以使用fmakunbound删除函数定义(使用defun或defgeneric创建).