Completed
Details
Assignee
UnassignedUnassignedReporter
Shogo OhtaShogo OhtaApproval
OkPatch
CodePriority
MajorAffects versions
Fix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Shogo Ohta
Shogo OhtaApproval
Ok
Patch
Code
Priority

Affects versions
Fix versions
Created March 1, 2014 at 6:02 AM
Updated September 14, 2018 at 10:21 PM
Resolved September 14, 2018 at 10:21 PM
As reported here (https://groups.google.com/forum/?hl=en#!topic/clojure-dev/n83hlRFsfHg), the empty map literal is read as a different map each time.
user=> (identical? (read-string "{}") (read-string "{}")) false
Making the reader return the same empty map when it reads an empty map is expected to improve some memory efficiency, and also lead to consistency with the way other collection literals are read in.
user=> (identical? (read-string "()") (read-string "()")) true user=> (identical? (read-string "[]") (read-string "[]")) true user=> (identical? (read-string "#{}") (read-string "#{}")) true
Cause: LispReader calls RT.map() with an empty array when it reads an empty map, and RT.map() in turn makes a new map unless its argument given is null.
Approach: make RT.map() return the same empty map when the argument is an empty array as well, not only when null
Patch: 0002-make-the-reader-return-the-same-empty-map-when-it-re.patch
Screened by: Alex Miller