read me

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 ...

(Community Standards)

Aug 30, 2010 some comments

As with any Lisp ever created , Clojure has recently been infected with talk of alternative layout styles of closing (and in some cases , ...

Monkeying with Clojure’s comp Function

Aug 18, 2010 some comments

A slight modification to Clojure's comp function gives me more power: [sourcecode lang="clj" gist="537860"] (defn comp+ ([] identity) ([f] f) ([f g] (fn ([] (f (g))) ...

Monkeying with Clojure’s defmethod Macro

Aug 10, 2010 some comments

I've at times1 found the need to use the precise match form of Clojure's multimethod dispatch value. For example: (defmulti repeating-mm (juxt first second)) (defmethod repeating-mm [1 2] [_] (str [1 2])) (repeating-mm (range 1 10)) ;=> "[1 2]" repeating-mm works as I would expect, but ...

MartinOdersky take(5) toList

Aug 6, 2010 some comments

Dr. Martin Odersky, the lead designer/developer of the Scala Programming Language, Generic Java, and Pizza requires no introduction, but the motivation for this micro-interview does. That is, there is an unfortunate view in some circles that sees the existence of Scala ...

Continue >>