Skip to content

Instantly share code, notes, and snippets.

@jacktasia
Created October 25, 2013 22:00
Show Gist options
  • Save jacktasia/7162485 to your computer and use it in GitHub Desktop.
Save jacktasia/7162485 to your computer and use it in GitHub Desktop.
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