首页 文章

Clojure,全新安装:无法解析符号:some->

提问于
浏览
0

我刚刚安装了最新版本的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 verison 2.5.3 . Java版本1.7.0_91 .

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

我一直在寻找几个小时,看起来 some-> 应该是Clojure v1.5的标准功能

我为什么不拥有它?

1 回答

  • 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左右 .

相关问题