我正在尝试间谍镜,按照记录的示例,我得到:
user=> (take 20 (repeat #spy/d (+ 1 2 3)))
RuntimeException No reader function for tag spy/d clojure.lang.LispReader$CtorReader.readTagged (LispReader.java:1245)
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)
我~/.lein/profile.clj
是:
{:user {:dependencies [[spyscope "0.1.6"]]
:injections [(require 'spyscope.core)
(use 'clojure.tools.trace)]
:plugins [[lein-try "0.4.3"]]
}
}
我对莱宁根的版本是:
$ lein --version
Leiningen 2.8.1 on Java 1.8.0_212 OpenJDK 64-Bit Server VM
我似乎找不到有关如何解决此问题的任何答案。
回答我自己的问题,让下一个人更容易寻找解决方案。
答案可以追溯到[这个问题]:(https://github.com/dgrnbrg/spyscope/issues/8(
Lein 2允许用户在非项目目录中触发
lein repl
,就是这种情况
您必须在具有project.clj
文件的目录中使用 spyscope。
您可以在 profiles.clj 以这种方式使用 spyscope
; try/catch to workaround an issue where `lein repl` outside a project dir
; will not load reader literal definitions correctly:
(try (require 'spyscope.core)
(catch RuntimeException e))