关于异常:正在加载Clojure.core.match

Loading Clojure.core.match

我是Clojure的新手,我想使用Clojure core.match:
https://github.com/clojure/core.match

我已使用以下捆绑包使用TextMate设置了我的项目:https://github.com/swannodette/textmate-clojure

我的project.clj如下:

1
2
3
(defproject Prototype"0.0.1-SNAPSHOT"
  :description"Prototype ARS Implementation"
  :dependencies [[clojure"1.3.0"] [org.clojure/core.match"0.2.0-alpha6"]])

在终端中,我执行:

1
cake deps

下载了正确版本的Clojure和Clojure.core.match jar文件。
现在,我正在编辑" src / Prototype / core.clj",并且想要使用匹配功能。

我尝试使用GitHub页面上提供的两个代码:

1
2
3
4
5
;; when using HEAD
(use '[clojure.core.match :only [match]])

;; when using the latest released alpha
(use '[clojure.core.match.core :only [match]])

这是我当前的代码:

1
2
3
4
5
6
7
8
(ns Prototype.core
  (use '[clojure.core.match.core :only [match]]))

(println
  (let [x [1 2]]
    (match [x]
      [[1 2]]"It worked!"
      :else"It failed!")))

当我将文件加载到cake repl中时;我收到以下错误:

1
lib names inside prefix lists must not contain periods

有什么想法吗?
干杯。


1
2
3
4
5
6
7
8
(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。)