【发布时间】:2014-01-31 20:45:34
【问题描述】:
我正在尝试遵循 Clojure Data Analasys Cookbook 中的示例。我正在使用 LightTable 来玩这个程序。第一个例子展示了如何读入 .csv 数据。
我使用了 lein new getting-data。然后我将这两个依赖项添加到项目文件中
(defproject getting-data "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [
[org.clojure/clojure "1.5.1"]
[incanter/incanter-core "1.4.1"]
[incanter/incanter-io "1.4.1"]
]
)
然后在 core.clj 文件中我说如下,在 LightTable 中使用 cmd-shift-enter 来评估程序,但我得到了这些异常:
(use 'incanter.core 'incanter.io)
clojure.lang.Compiler$CompilerException:java.lang.RuntimeException:无法解析符号:在此上下文中使用,正在编译:(/Users/idf/Documents/clojure/getting-data/src/getting_data/core.clj :1:1)
(read-dataset "data/small-sample.csv")
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: read-dataset in this context, 编译:(/Users/idf/Documents/clojure/getting-data/src/getting_data/core .clj:4:1)
不确定我做错了什么?
【问题讨论】:
-
你能展示你的整个 project.clj 吗?
-
刚刚编辑了帖子。
-
你是如何评估/编译表达式的?
-
顺便说一句,您的 project.clj 看起来不错。
-
参见上面的重写。我正在使用 LightTable,使用 cmd-shift-enter
标签: clojure lighttable