There are a lot of tools online that take a JSON text and show you formatted and well indented format of the same.
Some go even further and make a nice tree-like structu
There is now https://github.com/weavejester/cljfmt for that purpose
Add it in your Leiningen plugins:
:plugins [[lein-cljfmt "0.6.1"]]
Then, to autoformat all code in your project:
lein cljfmt fix
Your sample code will become:
(defn prime? [n known] (loop [cnt (dec (count known)) acc []] (if (< cnt 0) (not (any? acc))
(recur (dec cnt) (concat acc [(zero? (mod n (nth known cnt)))])))))
After adding some linebreaks and reformatting again:
(defn prime? [n known]
(loop [cnt (dec (count known)) acc []]
(if (< cnt 0) (not (any? acc))
(recur (dec cnt) (concat acc [(zero? (mod n (nth known cnt)))])))))