有很多在线工具可以获取 JSON 文本,并显示相同的格式和良好的缩进格式。
有些人走得更远,制作了一个漂亮的树状结构:http: //jsonviewer.stack.hu/
Clojure 代码有类似的东西吗?
或者至少可以自动缩进它的东西。
如果我的文字是这样的:
(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)))])))))
它应该自动缩进如下:
(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)))])))))