Clojure,全新安装:无法解析符号:有些>



我刚刚安装了Clojure的最新版本,同时遵循Liberator的教程(http://clojure-liberator.github.io/liberator/tutorial/getting-started.html),我得到以下异常:

Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: some-> in this context, compiling:(clout/core.clj:88)
at clojure.lang.Compiler.analyze(Compiler.java:6281)
at clojure.lang.Compiler.analyze(Compiler.java:6223)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3497)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6457)
at clojure.lang.Compiler.analyze(Compiler.java:6262)
... ...
Caused by: java.lang.RuntimeException: Unable to resolve symbol: some-> in this context
at clojure.lang.Util.runtimeException(Util.java:170)
at clojure.lang.Compiler.resolveIn(Compiler.java:6766)
at clojure.lang.Compiler.resolve(Compiler.java:6710)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6671)
at clojure.lang.Compiler.analyze(Compiler.java:6244)
... 114 more
Tests failed.

我使用的是Ubuntu 15.04。Leiningen版本2.5.3。Java版本1.7.0_91。

Lein-Repl工作得很好,虽然它理解(some ...),但无法解决(some-> ...)

我已经搜索了几个小时,看起来some->应该是Clojure v1.5+的标准函数

为什么我没有呢?

从教程链接中,project.clj是:

(defproject liberator-tutorial "0.1.0-SNAPSHOT"
  :plugins [[lein-ring "0.8.11"]]
  :ring {:handler liberator-tutorial.core/handler}
  :dependencies [[org.clojure/clojure "1.4.0"] ;; <-!!!!!!!!!!!!!!!!
                 [liberator "0.13"]
                 [compojure "1.3.4"]
                 [ring/ring-core "1.2.1"]])

所以您运行的是Clojure 1.4.0。尝试将其更改为1.7.0左右。

最新更新