<< Back to previous view

[CLJ-807] hash-maps print-dup as literal, thus can be read as array-maps Created: 07/Jun/11  Updated: 03/Sep/13

Status: Open
Project: Clojure
Component/s: None
Affects Version/s: Release 1.3
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Alexander Taggart Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: print


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

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

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

Comment by Aaron Bedra [ 28/Jun/11 6:47 PM ]

Rich: do you want a patch for this?

Comment by Rich Hickey [ 29/Jul/11 7:42 AM ]

Only if it important to someone, solves some problem.

Generated at Tue Jan 16 13:53:49 CST 2018 using JIRA 4.4#649-r158309.