Welcome! Please see the About page for a little more info on how this works.

0 votes
in Printing by
Per Rich in CLJ-799: "The point of print-dup is type preservation"


user=> (hash-map :k :v)
{:k :v}
user=> (type *1)
clojure.lang.PersistentHashMap
user=> (binding [*print-dup* true] (print-str *2))
"{:k :v}"
user=> (read-string *1)
{:k :v}
user=> (type *1)
clojure.lang.PersistentArrayMap


The cause is due to {{RT.map}} conditionally creating an array-map if the size is within the {{PersistentArrayMap.HASHTABLE_THRESHOLD}}.

3 Answers

0 votes
by

Comment made by: aaron

Rich: do you want a patch for this?

0 votes
by

Comment made by: richhickey

Only if it important to someone, solves some problem.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-807 (reported by ataggart)
...