Created
October 25, 2013 22:00
-
-
Save jacktasia/7162485 to your computer and use it in GitHub Desktop.
Pretty print clojure code
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
(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