|
92 | 92 |
|
93 | 93 | ;;; (def pprint-map (formatter-out "~<{~;~@{~<~w~^ ~_~w~:>~^, ~_~}~;}~:>"))
|
94 | 94 | (defn- pprint-map [amap]
|
95 |
| - (pprint-logical-block :prefix "{" :suffix "}" |
96 |
| - (print-length-loop [aseq (seq amap)] |
97 |
| - (when aseq |
98 |
| - (pprint-logical-block |
99 |
| - (write-out (ffirst aseq)) |
100 |
| - (.write ^java.io.Writer *out* " ") |
101 |
| - (pprint-newline :linear) |
102 |
| - (set! *current-length* 0) ; always print both parts of the [k v] pair |
103 |
| - (write-out (fnext (first aseq)))) |
104 |
| - (when (next aseq) |
105 |
| - (.write ^java.io.Writer *out* ", ") |
106 |
| - (pprint-newline :linear) |
107 |
| - (recur (next aseq))))))) |
| 95 | + (let [[ns lift-map] (when (not (record? amap)) |
| 96 | + (#'clojure.core/lift-ns amap)) |
| 97 | + amap (or lift-map amap) |
| 98 | + prefix (if ns (str "#:" ns "{") "{")] |
| 99 | + (pprint-logical-block :prefix prefix :suffix "}" |
| 100 | + (print-length-loop [aseq (seq amap)] |
| 101 | + (when aseq |
| 102 | + (pprint-logical-block |
| 103 | + (write-out (ffirst aseq)) |
| 104 | + (.write ^java.io.Writer *out* " ") |
| 105 | + (pprint-newline :linear) |
| 106 | + (set! *current-length* 0) ; always print both parts of the [k v] pair |
| 107 | + (write-out (fnext (first aseq)))) |
| 108 | + (when (next aseq) |
| 109 | + (.write ^java.io.Writer *out* ", ") |
| 110 | + (pprint-newline :linear) |
| 111 | + (recur (next aseq)))))))) |
108 | 112 |
|
109 | 113 | (def ^{:private true} pprint-set (formatter-out "~<#{~;~@{~w~^ ~:_~}~;}~:>"))
|
110 | 114 |
|
|
0 commit comments