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

Description

Short example illustrating the behavior:

Cause: pprint overrides collection printing and ignores print-meta, falls back to pr for other things.

Proposed: pprint should print meta on collections when *print-meta* is true.

Patch: clj-1445.patch

Screened by: Ghadi. Does what it purports to do, no reflection introduced.

Environment

None

Activity

Show:
Andy Fingerhut
June 13, 2014, 5:30 PM

Attached file clj-1445-workaround-v1.clj is a function that pprints with more metadata than clojure.pprint does. As noted in the comments, it may not show metadata on other metadata. Please update with an enhanced version if you create one.

Andy Fingerhut
June 13, 2014, 6:26 PM

Attached file clj-1445-workaround-v2.clj supersedes the earlier one, which I will delete.

The included function pprint-meta appears to be a correct way to pprint values with all metadata, even if the metadata maps themselves have metadata on them.

Alex Miller
December 11, 2020, 7:09 PM

Applied for 1.10.2-rc1

Fixed

Assignee

Unassigned

Reporter

Andy Fingerhut

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Priority

Minor
Configure