We're updating the issue view to help you get more done. 

pprint prints some metadata when *print-meta* bound to true, but not all

Description

Short example illustrating the behavior:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 user=> *clojure-version* {:major 1, :minor 6, :incremental 0, :qualifier nil} user=> (def f1 '(defn foo [^Integer x] ^{:bar 8} (inc x))) #'user/f1 ;; pr shows all metadata, as expected user=> (binding [*print-meta* true] (pr f1)) ^{:line 2, :column 10} (defn foo [^Integer x] ^{:bar 8, :line 2, :column 33} (inc x))nil ;; pprint shows some metadata, but not all user=> (binding [*print-meta* true] (clojure.pprint/pprint f1)) (defn foo [^Integer x] (inc x)) nil

I have not dug into the details yet, but it appears that this may be because pprint uses pr to show symbols, but not to show collections. Thus pprint shows metadata on symbols, but not collections.

It would be nice if pprint could instead show all metadata, as pr does, when print-meta is bound to true.

Environment

None

Status

Assignee

Unassigned

Reporter

Andy Fingerhut

Labels

Approval

None

Patch

None

Affects versions

Release 1.6

Priority

Minor