Fixed
Details
Assignee
UnassignedUnassignedReporter
importimportLabels
Approval
OkPatch
Code and TestPriority
MinorAffects versions
Fix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
import
importLabels
Approval
Ok
Patch
Code and Test
Priority
Affects versions
Fix versions
Created January 21, 2019 at 3:41 AM
Updated September 25, 2020 at 7:23 PM
Resolved September 25, 2020 at 7:23 PM
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-3.patch alters this to instead build a seq-ordered kv vector to retain order. It also adds many tests for various namespace map printing that were missing, including some new ones for this ticket and CLJ-2537.
Another option (not taken here) would be to only print namespace maps with PAM/PHM - this could probably be handled polymorphically in the print methods.
Patch: clj-2469-3.patch
Screened by: Ghadi