Skip to content

Commit

Permalink
Fix file / line reporting for lazy defn loading, fixes functional-koa…
Browse files Browse the repository at this point in the history
  • Loading branch information
trptcolin committed Apr 19, 2011
1 parent 99eb972 commit ff7623f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/path_to_enlightenment.clj
@@ -1,7 +1,8 @@
(ns path-to-enlightenment
(:use [clojure.test])
(:require [clojure.set]
[clojure.string]))
[clojure.string]
[clojure.test]))

(def __ :fill-in-the-blank)
(def ___ (fn [& args] __))
Expand All @@ -10,14 +11,16 @@
(System/exit 0))

(defmacro meditations [& forms]
(let [pairs (partition 2 forms)]
`(do
~@(map
(fn [[doc# code#]]
`(if (is ~code# ~doc#)
:pass
(handle-problem)))
pairs))))
(let [pairs (partition 2 forms)
pairs (conj pairs
["Bootstrap for file/line reporting"
'(clojure.test/is (= 0 0))])
tests (map (fn [[doc# code#]]
`(if (is ~code# ~doc#)
:pass
(handle-problem)))
pairs)]
`(do ~@tests)))

(def ordered-koans
["equalities"
Expand Down Expand Up @@ -62,5 +65,5 @@

(defn run []
(require-version (parse-required-version))
(apply load (doall (map (partial str "koans/") ordered-koans)))
(doall (map (comp load (partial str "koans/")) ordered-koans))
(println "You have achieved clojure enlightenment. Namaste."))

0 comments on commit ff7623f

Please sign in to comment.