Added check of sufficiently new clojure version.

This should prevent users of old clojure versions
from running koans and getting strange results.
This commit is contained in:
Ben Lickly 2011-01-11 14:48:26 -08:00
parent 26c702ffd0
commit a987607134

View File

@ -30,6 +30,14 @@
"destructuring"
"refs"])
(defn require-version [[required-major required-minor]]
(let [{:keys [major minor]} *clojure-version*]
(if (or (< major required-major)
(and (== major required-major) (< minor required-minor)))
(throw (Exception. (str "Clojure version " required-major "."
required-minor " or higher required."))))))
(defn run []
(require-version [1 3])
(apply load (doall (map (partial str "koans/") ordered-koans)))
(println "You have achieved clojure enlightenment. Namaste."))