Formatting of list returned from call to `clojure.core/into`
Hi Eero - Awesome library, thanks for making it! It has been a super useful and performant alternative to clojure.pprint/pprint.
I was working inside a project today and I noticed a small difference in the printing of a list that was returned from a call to clojure.core/into. As a sanity check, I reproduced the same thing in a clean sandbox project:
(ns sandbox-clj.core
(:require
[me.flowthing.pp :as pp]
[clojure.pprint]))
(clojure.pprint/pprint (into [] {:a 1 :b 2}))
;; => [[:a 1] [:b 2]]
(pp/pprint (into [] {:a 1 :b 2}))
;; => [:a 1, :b 2]
(clojure.pprint/pprint (into '() {:a 1 :b 2}))
;; => ([:b 2] [:a 1])
(pp/pprint (into '() {:a 1 :b 2}))
;; => (:b 2, :a 1)
(clojure.pprint/pprint (into #{} {:a 1 :b 2}))
;; => #{[:b 2] [:a 1]}
(pp/pprint (into #{} {:a 1 :b 2}))
;; => #{:b 2, :a 1}
P.S.
I edited the example above from the original issue which was an example specific to clojure.spec.alpha/conform, where I first noticed it. Shortly after realized it was not specific to the output of conform when i saw it happening with into.
Thanks for the report! I'll take a look when I get the chance.
The bug is that pp prints map entries (clojure.lang.MapEntry) as if they were inside maps even when they're in other types of collections.
user=> (pprint [(clojure.lang.MapEntry. :a 1)])
[:a 1]
I'll fix that.
This case turned out to be a bit trickier than I expected, but I think I have a fix now. Hope to have a new version out later this week.
This should be fixed in 2024-09-09.69. If you get the chance, can you give it a try and let me know whether that fixes the issue for you?
Works perfectly now. Thank you very much for the timely fix!
Great, thanks for reporting back!