refer-clojure for boot repl

时间:2017-07-19 01:40:16

标签: clojure namespaces read-eval-print-loop

我尝试设置boot让我在REPL中使用better-cond。我把它放到我的build.boot中:

(refer-clojure :exclude '[rand rand-int struct cond])
(require '[better-cond.core :refer [cond]])

然而,当我开始boot repl时,我收到此警告:

WARNING: cond already refers to: #'clojure.core/cond in namespace: boot.user,
being replaced by: #'better-cond.core/cond

cond确实调用了更好的cond,但是如何摆脱警告?

我不想养成忽略编译器警告的习惯。

1 个答案:

答案 0 :(得分:1)

如果您希望使用boot.user,则可以使用ns-unmap代替refer-clojure

$ boot -d better-cond:1.0.1 repl
boot.user=> (run! #(ns-unmap *ns* %) '[rand rand-int struct cond])
boot.user=> (require '[better-cond.core :refer [cond]])