pr botches structmaps containing namespaced keys when *print-namespace-maps*

Description

pr misrepresents a structmap containing namespaced-keyword keys. pr misstates actual keys' values, and includes phantom keys.

It worked in Clojure 1.8, and disabling the print-namespace-maps feature appears to work around the problem:

Similar can also occur in sorted maps, or in other map-likes that don't respond well with `empty` (in particular, maps that have expected seq orders based on the keys). See CLJ-2537.

Cause: The implementation of namespace map printing relies on extracting the namespace prefix (when applicable), stripping that prefix from keys, and rebuilding the map with `empty`. For maps other than PHM, this can fail.

Approach: clj-2469.patch alters this to instead build a seq-ordered kv vector, and then uses an array-map to retain that order. It also adds many tests for various namespace map printing that were missing, including some new ones for this ticket and CLJ-2537.

Environment

None

Assignee

Unassigned

Reporter

import

Labels

Approval

Vetted

Patch

None

Affects versions

Priority

Minor
Configure