<< 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


 Description   

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.



 Comments   
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 Mon Sep 01 21:47:13 CDT 2014 using JIRA 4.4#649-r158309.