Skip to content

Instantly share code, notes, and snippets.

@jacktasia
Created Oct 25, 2013
Embed
What would you like to do?
Pretty print clojure code
(use 'clojure.pprint)
(require ' [clojure.edn :as edn])
(let [file-contents (slurp "clojure_test2.clj")
process-file (with-out-str
(clojure.pprint/write
(edn/read-string (str "[" file-contents "]"))
:dispatch
clojure.pprint/code-dispatch))]
(println (subs process-file 1 (- (.length process-file) 1))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment