奇怪的自动完成导致emacs +常见的lisp

时间:2016-09-27 07:09:46

标签: common-lisp slime completion

我在我的开发环境中使用带有SLIME的Emacs。当我输入(write-to然后C-M-i时,我会收到以下自动填充内容:

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
write-to-sting
write-to-string

我知道Common Lisp很强大,但我猜write-to-sting不符合ANSI标准。谷歌没有为这个功能提供一次点击。然后我尝试在SBCL代码中找到它,但是alas

(documentation 'write-to-sting 'function)返回nil,因此它没有文档字符串。

当我尝试执行函数(write-to-sting)时,我得到The function COMMON-LISP-USER::WRITE-TO-STING is undefined.

Apropos还发现了一个未绑定的函数:

(apropos 'write-to)
WRITE-TO
WRITE-TO-STING
WRITE-TO-STRING (fbound)

我的问题是:发生了什么?有谁知道这个功能背后的故事?

1 个答案:

答案 0 :(得分:9)

在您与Lisp环境交互的某个时刻,写了write-to-sting并且它被Lisp读者读取。该符号在COMMON-LISP-USER包中实现。毕竟,也许你打算实现一个向Sting发送电子邮件的功能,谁知道呢? 自动完成通过过滤环境中当前已知的符号来工作。

您可以放心(unintern 'write-to-sting)(或实施它)。