I am at the REPL, and I create a java array:
=> (def arr (double-array [1 2 3]))
Of course, if I want to look at my arr, I get:
=> arr
#<double[] [D@2ce628d8>
Is there anything I can do that will make arrays of java primitives print like clojure’s persistentVectors?
=> arr
[1.0 2.0 3.0]
I know I could wrap my arrays in some sort of nice printing function (which is what I currently do), but this is a pain in cases, for example, where the vectors are part of a map:
=> my-map
{"1" #<double[] [D@47254e47>, "2" #<double[] [D@11d2625d>}
Would something as simple as the following do?
If it’s only for the REPL, then perhaps the technical semantics don’t matter.
Update
It turns out that pretty print (pprint) works just fine with your map of vectors:
Final Update: From the linked Google Groups discussion in the comments
Questioner found an answer he liked in a discussion paraphrased below: