Created
April 20, 2020 08:48
-
-
Save jamesdavidson/d53c9741eb9b2dea255d8d9c50a96413 to your computer and use it in GitHub Desktop.
How to mess around with (ns ...) declarations in Clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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