如何改进 clisp 错误消息?
我已经接触过一些clisp。 有点令人困惑的是它没有打印出错误所在的行号。 或者,至少给出错误所在的一般提示。 在某些情况下这一定是可能的,对吧? 有什么方法可以获得更好的错误消息吗?
I have been dabbling a little with clisp. It is a little perplexing that it doesn't print out the line number an error is at. Or, at least a general hint where the error is located. In some cases that must be possible, right? Is there any way I can get better error messages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如我看到的大多数涉及 clisp 的问题一样,答案可能是“不要使用 clisp”。
您可能知道,clisp 只是 Common Lisp 的众多实现之一,而且可能不是更流行的实现之一。 对于大多数任务来说,SBCL、Clozure、Allegro 和 LispWorks 可能是更好的选择。
编辑:
此外,在 emacs 中使用 SLIME 来调试程序也有很大帮助。 即使使用 SLIME 从 clisp(和其他)中,您也可能获得更好的调试器输出。
As in most questions I see involving clisp, the answer is probably "don't use clisp".
As you might be aware, clisp is but one of many implementations of Common Lisp, and probably not one of the more popular ones. SBCL, Clozure, Allegro, and LispWorks are probably better choices for most tasks.
edit:
Also, using SLIME in emacs to debug your programs helps a good deal. You might get better debugger output even from clisp (and the others) using SLIME.
首先,Lisp 阅读器读取表单,而不是行,因此“行号”对它来说没有什么意义。
也就是说,Lisp 知道表单开始和结束的行,并且这些值实际上是由 SLIME 报告的。 默认情况下不报告它们的原因是 假定调试器将执行此操作在必要且适当的情况下可获取的信息。
First of all, Lisp reader reads forms, not lines, so "line number" makes little sense to it.
That said, Lisp knows the lines where the form starts and ends, and those values are actually reported by SLIME. The reason they are not reported by default is that it is assumed that the debugger will make this information accessible in situations where it is necessary and appropriate.