其他答案涵盖了这个问题。
但是,从实践层面,如果你正在使用的Common Lisp和煤泥,并希望能够编译代码到退出Emacs正在运行的程序,你需要告诉斯旺克从您的循环内进行更新。
将以下内容添加到您的代码中,然后在循环中添加(更新swank)。
(defmacro continuable (&body body)
`(restart-case
(progn ,@body)
(continue() :report "Just Continue")))
(defun update-swank()
"Called from within the main loop, this keep the lisp repl working"
(continuable
(let ((connection (or swank::*emacs-connection*
(swank::default-connection))))
(when connection
(swank::handle-requests connection t)))))
这是使用你可以用你的编辑器重新编译直播as in this video(对不起,我堵自己的VID)事实的一种方式。
另一种方式(再次与斯莱姆)是告诉它使用不同的线程进行通信。但我更喜欢前一种方法,因为在跨线程使用时,opengl非常不稳定。
[详细信息] 上述代码中的可持续宏捕获任何错误,并让您选择忽略它并继续。我发现这真的很有帮助,我经常在repl中犯错误,我不想从错误中“中止”,因为这会中止我的主循环。
我不知道具体实施的 - 但看的人,当他们评价不编译。因此,这将排除SBCL的实例(可能还有很多现代的Common Lisp实现)。 – verdammelt
基本上是一个副本:http://stackoverflow.com/questions/16914779/levels-of-homoiconicity –
@verdammelt:请参阅http://www.sbcl.org/manual/#Interpreter –