Pretty print in Clojure

浪尽此生 提交于 2019-12-20 17:29:30

问题


Is there a pretty printing function in Clojure that would output data-structures like lists and structs in a human-readable way?


回答1:


clojure-contrib now has a pprint function.

The API documentation is at http://richhickey.github.com/clojure-contrib/pprint-api.html




回答2:


As Chouser has mentioned, in 1.3 pprint is moved into clojure itself.

http://clojure.github.io/clojure/clojure.pprint-api.html#clojure.pprint/pprint

You can (:require clojure.pprint) and start using it.




回答3:


A pretty printer for Clojure is available here.




回答4:


There was a post on the Clojure mailing list yesterday, where a few people posted some trial implementations of a pretty-printer. But as mipadi said, it's not finalized yet.




回答5:


Not yet, but the feature has been discussed and is (presumably) under development by a couple people close to Clojure.




回答6:


As the others have said, planned but incomplete. When clojure.contrib.pprint is moved into clojure itself, an update will be posted to its ticket.



来源:https://stackoverflow.com/questions/295458/pretty-print-in-clojure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!