tools.reader

Check for duplicate keys when reading sets and maps in ClojureScript impl

Details

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

Description

The Clojure implementation of tools.reader delegates to some runtime support in classes in clojure.lang when reading maps and sets in order to check for duplicate keys, but the ClojureScript implementation delegates to standard lib fns (set and hash-set). This results in no duplicate key checks for the ClojureScript implementation.

Activity

Hide
Erik Assum added a comment -
Show
Erik Assum added a comment - Be advised, I found http://dev.clojure.org/display/design/Allow+duplicate+map+keys+and+set+elements while working on this patch.
Hide
Nicola Mometto added a comment -

Thanks Erik.
That article you linked describes runtime behaviour, not read-time. Read time constructs should always throw on duplicate keys, no matter what the runtime constructs do.

This patch only fixes sets, can you also extend this for map keys? Thanks!

Show
Nicola Mometto added a comment - Thanks Erik. That article you linked describes runtime behaviour, not read-time. Read time constructs should always throw on duplicate keys, no matter what the runtime constructs do. This patch only fixes sets, can you also extend this for map keys? Thanks!
Hide
Erik Assum added a comment -

Now also done for maps.

Show
Erik Assum added a comment - Now also done for maps.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: