I’m new to Clojure and I’m wanting to use Clojure core.match:
https://github.com/clojure/core.match
I’ve setup my project with TextMate using the following bundle: https://github.com/swannodette/textmate-clojure
My project.clj is as follows:
(defproject Prototype "0.0.1-SNAPSHOT"
:description "Prototype ARS Implementation"
:dependencies [[clojure "1.3.0"] [org.clojure/core.match "0.2.0-alpha6"]])
In terminal, I executed:
cake deps
Which downloaded the correct version of Clojure and the Clojure.core.match jar files.
Now I’m editing my ‘src/Prototype/core.clj’ and I’m wanting to use the match functionality.
I’ve tried using both the provided code on the GitHub page:
;; when using HEAD
(use '[clojure.core.match :only [match]])
;; when using the latest released alpha
(use '[clojure.core.match.core :only [match]])
This is my current code:
(ns Prototype.core
(use '[clojure.core.match.core :only [match]]))
(println
(let [x [1 2]]
(match [x]
[[1 2]] "It worked!"
:else "It failed!")))
When I load the file into the cake repl; I get the following error:
lib names inside prefix lists must not contain periods
Any ideas?
Cheers.
There’s no need to quote in the
nsform.(I’ve assumed
clojure.core.match.corewas the correct namespace. If it doesn’t work useclojure.core.matchinstead.)