Skip to content

Instantly share code, notes, and snippets.

@weavejester
Created October 14, 2009 20:43
Show Gist options
  • Save weavejester/210384 to your computer and use it in GitHub Desktop.
Save weavejester/210384 to your computer and use it in GitHub Desktop.
(defmacro with-ns [ns & body]
`(binding [*ns* (the-ns ~ns)]
~@(map (fn [form] `(eval '~form)) body)))
(with-ns 'clojure.core
(def in-ns* in-ns)
(defn in-ns [name]
(doseq [dep (-> name meta :deps)]
(capra.package/install dep))
(in-ns* name)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment