<< Back to previous view

[CLJ-799] ArrayMaps print-dup with read-eval Created: 16/May/11  Updated: 27/May/11  Resolved: 27/May/11

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

Type: Defect Priority: Minor
Reporter: Alexander Taggart Assignee: Alexander Taggart
Resolution: Declined Votes: 0
Labels: None

Attachments: Text File print-dup-array-maps.patch    
Patch: Code and Test
Waiting On: Stuart Halloway

 Description   
user=> (binding [*print-dup* true] (print-str (hash-map :k :v)))
"{:k :v}"
user=> (binding [*print-dup* true] (print-str {:k :v}))
"#=(clojure.lang.PersistentArrayMap/create {:k :v})"

In the top example, the reader will automatically create an array-map due to the number of entries, so unless there is an overriding reason to force type-preservation in the bottom example, it can likewise be printed as a literal map.



 Comments   
Comment by Alexander Taggart [ 21/May/11 9:56 PM ]

Apply patch after CLJ-797.

Comment by Rich Hickey [ 27/May/11 7:38 AM ]

The point of print-dup is type preservation

Generated at Sat Jul 26 04:14:57 CDT 2014 using JIRA 4.4#649-r158309.