Java array formatting
Found an edge case hiding in a corner ...
(clojure.pprint/pprint (into-array '(1 2 3)))
;; Prints:
;; [1, 2, 3]
(me.flowthing.pp/pprint (into-array '(1 2 3)))
;; Prints:
;; #object["[Ljava.lang.Long;" 0x346690d6 "[Ljava.lang.Long;@346690d6"]
Thanks for reporting. I'll fix that.
:pray:
Interesting that clojure.pprint/pprint prints Java arrays differently from prn:
user=> (prn (byte-array [(int \a) (int \b) (int \c)]))
#object["[B" 0x77380939 "[B@77380939"]
nil
user=> (prn (into-array [1 2 3]))
#object["[Ljava.lang.Long;" 0x46ceabe5 "[Ljava.lang.Long;@46ceabe5"]
nil
It is also interesting that clojure.pprint/pprint prints commas in arrays, but not in Clojure colls:
user=> (clojure.pprint/pprint (into-array [1 2 3]))
[1, 2, 3]
user=> (clojure.pprint/pprint [1 2 3])
[1 2 3]
I don't know that I want to pp to have that inconsistency.
This should be fixed in 2024-11-13.77. Can you give it a try and let me know whether it's fixed for you?
Works great on my side. Thanks for the quick fix!