Pretty print in Clojure

Asked by At

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

6 Answers

Ajit George On Best Solutions

clojure-contrib now has a pprint function.

The API documentation is at

mipadi On

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

Brian Carper On

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.

Chouser On

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.

Mark Probst On

A pretty printer for Clojure is available here.

ktsujister On

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

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