Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Change *print-right-margin* in Clojure REPL
(defmacro with-ns
"Evaluates body in another namespace. ns is either a namespace
object or a symbol. This makes it possible to define functions in
namespaces other than the current one."
[ns & body]
`(binding [*ns* (the-ns ~ns)]
~@(map (fn [form] `(eval '~form)) body)))
(with-ns 'clojure.pprint (def ^:dynamic *print-right-margin* 140))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.