一个初学者的问题。
使用lein + emacs + nrepl运行clojure。
我对以下内容有些困惑:
我希望使用指数函数。这个函数位于clojure.math.numeric-tower
。我将[org.clojure/math.numeric-tower "0.0.1"]
添加到依赖项中,并运行lein deps
。
现在,是否可以(我确信可以)将其添加到我的.core ns
中,如下所示:
(ns learning.core
(:require [clojure.math.numeric-tower :as math]))
(def i-know-the-answer
(math/expt 2 10))
现在我尝试将此内容加载到REPL中 (ctl-x e
),但它会抛出错误。
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such namespace: math, compiling:(NO_SOURCE_PATH:2)
这些依赖关系需要直接加载到REPL中吗?我不能只更改源文件/重新编译它并使用它吗?