read


read
or learn more

Monkeying with Clojure’s deftest

Sep 3, 2010 some comments

Say you have a namespace a that needs to be tested: 1 (ns a) (defn ^{:private true} foo [] 42) Using Clojure’s clojure.test libs you might think it would be as simple as the following: (ns b (:use [clojure.test :only [deftest is]])) (deftest test-foo (is (= 42 (a/foo)))) ; java.lang.IllegalStateException: var: #’a/foo is not public […]

Monkeying with Clojure’s comp Function

Aug 18, 2010 some comments

A slight modification to Clojure’s comp function gives me more power…

Monkeying with Clojure’s defmethod Macro

Aug 10, 2010 some comments

I’ve at times found the need to use the precise match form of Clojure’s multimethod dispatch value — so created a macro to make it a little easier.

Continue