【发布时间】:2018-08-09 11:56:22
【问题描述】:
如何从clj 命令启动 nREPL?
我无法使用 Lein 或 Boot 运行我的项目,因为我在某处有一个不平衡的括号,而读者抱怨 `java.lang.RuntimeException: read-cond 从第 13 行开始需要偶数个表单。
【问题讨论】:
标签: clojure command-line-interface nrepl
如何从clj 命令启动 nREPL?
我无法使用 Lein 或 Boot 运行我的项目,因为我在某处有一个不平衡的括号,而读者抱怨 `java.lang.RuntimeException: read-cond 从第 13 行开始需要偶数个表单。
【问题讨论】:
标签: clojure command-line-interface nrepl
写了a gist如何做到这一点:
clj -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.12"}}}'
Clojure 1.9.0
user=> (use '[clojure.tools.nrepl.server :only (start-server stop-server)])
nil
user=> (defonce server (start-server :port 7888))
#'user/server
现在您可以使用远程 REPL 客户端连接到端口 7888。可能有一种方法可以在一行中做到这一点。
【讨论】:
现在事情比发布问题时要容易:
$ clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.5.3"}}}' -m nrepl.cmdline
更多详情here。
【讨论】: