Friday, 19 February 2010

how to :use in clojure

It took me a while to figure this out ... the docs are not obvious enough ;) ... so I am writing this down here fore future reference. To import a function from a package do the following:


(ns my-namespace
(:use [clojure.contrib.str-utils2 :only (capitalize)]))


Here I am importing the clojure.contrib.str-utils2/capitalize into my-namespace.

No comments: