Skip to content

Instantly share code, notes, and snippets.

@jamesdavidson
Created April 20, 2020 08:48
Show Gist options
  • Save jamesdavidson/d53c9741eb9b2dea255d8d9c50a96413 to your computer and use it in GitHub Desktop.
Save jamesdavidson/d53c9741eb9b2dea255d8d9c50a96413 to your computer and use it in GitHub Desktop.
How to mess around with (ns ...) declarations in Clojure
(binding [*ns* (find-ns 'some.other.namespace)]
(with-open [config (java.io.PushbackReader. (java.io.FileReader. "config.clj"))]
(loop []
(when-let [form (read {:eof nil} config)]
(do (eval form) (recur))))))
;; see also https://gist.github.com/vkz/4c32cdff75ba7254ed0c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment