我是Clojure的新手,我想使用Clojure core.match:https://github.com/clojure/core.match
我已经使用以下包使用TextMate设置了我的项目:https://github.com/swannodette/textmate-clojure
我的project.clj如下:
(defproject Prototype "0.0.1-SNAPSHOT"
:description "Prototype ARS Implementation"
:dependencies [[clojure "1.3.0"] [org.clojure/core.match "0.2.0-alpha6"]])在终端中,我执行了:
cake deps下载了正确版本的Clojure和Clojure.core.match jar文件。现在我正在编辑我的'src/Prototype/core.clj‘,我想使用匹配功能。
我已经尝试使用GitHub页面上提供的两个代码:
;; when using HEAD
(use '[clojure.core.match :only [match]])
;; when using the latest released alpha
(use '[clojure.core.match.core :only [match]])这是我当前的代码:
(ns Prototype.core
(use '[clojure.core.match.core :only [match]]))
(println
(let [x [1 2]]
(match [x]
[[1 2]] "It worked!"
:else "It failed!")))当我将文件加载到蛋糕repl中时,我得到了以下错误:
lib names inside prefix lists must not contain periods有什么想法吗?干杯。
发布于 2011-11-25 12:13:02
(ns Prototype.core
(:use [clojure.core.match.core :only [match]]))
(println
(let [x [1 2]]
(match [x]
[[1 2]] "It worked!"
:else "It failed!")))不需要在ns表单中引用。
(我假设clojure.core.match.core是正确的名称空间。如果不起作用,请改用clojure.core.match。)
https://stackoverflow.com/questions/8264718
复制相似问题