Clojure

GC Issue 83: PersistentArrayMap trust the reader (map literals) too much

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None

Description

Reported by karmazilla, Feb 17, 2009

What (small set of) steps will reproduce the problem?

PersistentArrayMap gets it wrong:

user=> {1 1 1 1 1 1 2 2}
{1 1, 1 1, 1 1, 2 2}

What is the expected output? What do you see instead?

But PersistentHashMap gets it right:

user=> (hash-map 1 1 1 1 1 1 2 2)
{1 1, 2 2}

What version are you using?

rev 1286.

Was this discussed on the group? If so, please provide a link to the 
discussion:
http://groups.google.com/group/clojure/browse_thread/
thread/5a38a6b61b09e025

Please provide any additional information below.

PersistentArrayMap seems to be the culprits. Line 65 to 73. They should 
probably assoc the individual items like PersistentHashMap do, I guess.

Activity

Hide
Assembla Importer added a comment -

richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)

Show
Assembla Importer added a comment - richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)
Hide
Assembla Importer added a comment -

hiredman said: [file:cJ9rlAc4Gr36CjeJe5aVNr]: add error detect to reader

Show
Assembla Importer added a comment - hiredman said: [file:cJ9rlAc4Gr36CjeJe5aVNr]: add error detect to reader
Hide
Assembla Importer added a comment -

hiredman said: patch adds some error detection to the map literal reader. covers the above case and also {:a}

Show
Assembla Importer added a comment - hiredman said: patch adds some error detection to the map literal reader. covers the above case and also {:a}
Hide
Assembla Importer added a comment -

devlinsf said: Could this issue be promoted to "Release - Bug Fix"?

Show
Assembla Importer added a comment - devlinsf said: Could this issue be promoted to "Release - Bug Fix"?
Hide
Assembla Importer added a comment -

richhickey said: (In [[r:e6e39d5931fbdf3dfa68cd2d059b8e26ce45c965]]) catch duplicate map keys for literals and hash- and array-map calls. Fixes #87

Branch: master

Show
Assembla Importer added a comment - richhickey said: (In [[r:e6e39d5931fbdf3dfa68cd2d059b8e26ce45c965]]) catch duplicate map keys for literals and hash- and array-map calls. Fixes #87 Branch: master

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: