Skip to content

Instantly share code, notes, and snippets.

@djKianoosh
Created May 10, 2012 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djKianoosh/2653859 to your computer and use it in GitHub Desktop.
Save djKianoosh/2653859 to your computer and use it in GitHub Desktop.
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