emacs - Slime 在我的 Clojure repl 中抛出 "Variable binding depth exceeds max-specpdl-size"

标签 emacs clojure read-eval-print-loop slime swank

我的 clojure repl 开始抛出“变量绑定(bind)深度超过 max-specpdl-size”错误,我被扔进了调试器。

我目前正在通过 clojure-jack-in 访问 slime,并且正在对一个合理大小的数据集执行 reduce。一些谷歌搜索让我相信这个错误是因为我生成了太多的临时变量,具体来说:

User Option: max-specpdl-size

This variable defines the limit on the total number of local variable bindings and unwind-protect cleanups (see Cleaning Up from Nonlocal Exits) that are allowed before Emacs signals an error (with data "Variable binding depth exceeds max-specpdl-size").

This limit, with the associated error when it is exceeded, is one way that Lisp avoids infinite recursion on an ill-defined function. max-lisp-eval-depth provides another limit on depth of nesting. See Eval.

The default value is 1000. Entry to the Lisp debugger increases the value, if there is little room left, to make sure the debugger itself has room to execute. found here.

我对调试 clojure-swank/slime 的经验很少,所以我希望有人能提供帮助。

编辑: 我将 clojure-mode 1.11.4 与 emacs 24 和 clojure 1.3.0 一起使用,我没有安装 swank-clojure,我使用的是通过 clojure-jack-in 与 clojure-mode 捆绑在一起的那个,正如我所解释的早些。

最佳答案

以防万一有人正在寻找这个问题的可能答案....

如前所述,此错误通常意味着存在问题,但并非总是如此。在具有大型数据结构或使用某些 emacs 功能(例如 defadvice,这可能导致深度绑定(bind)等)的情况下,您可以合法地超过默认深度设置。您可以增加深度并查看是否有帮助(例如, 加倍), 但在这种情况下它可能是一个错误。

swank-clojure 的一个问题是它与旧版本的 slime 紧密耦合。这意味着粘液中的改进和错误修复不可用。正是由于这种紧密绑定(bind),coljure 社区已经从使用 slime 转向使用 cider,我强烈建议改用 cider 而不是 slime 和 swank-clojure。

关于emacs - Slime 在我的 Clojure repl 中抛出 "Variable binding depth exceeds max-specpdl-size",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8500803/

相关文章:

emacs - 如何在完成阅读中立即显示所有完成?

clojure - 映射向量列表的第一个元素

emacs - pretty-print 和扩展

javascript - 当 NodeJS 应用程序设计为在客户端上运行时,如何在它的服务器端使用 javascript 库?

c++ - 为什么在 Emacs 中使用 CEDET 完成代码如此缓慢?

vim - 作为图形 IDE 用户,我应该对传统编辑器感兴趣吗?

emacs - 组织模式捕获: dynamic file name

clojure - 从 Clojure 访问在抽象基类上定义的公共(public)方法

scala - Scala 中是否可以解构输入参数?

python - 如何实现能够很好​​地处理异步输出的 python REPL?