On Feb 17, 3:30 pm, Christian Vest Hansen <karmazi...@gmail.com>
wrote:
> On Tue, Feb 17, 2009 at 9:08 PM, Christophe Grand <christo...@cgrand.net> 
> wrote:
>
> > Fixing array-map would make the two tests consistent but I'm not sure
> > that (let [a (atom 0)] {(swap! a inc) 1 (swap! a inc) 2 }) should
> > evaluate to {1 2}.
>
> That would make it two distinct issues, as I see it. One for
> array-map, and one for whether association happens before or after the
> keys have been evaluated.
>
> It would seem really strange to me if the following behavior is correct:
>
> user=> (def m (array-map 1 1 1 2 1 3))
> #'user/m
> user=> (m 1)
> 1
> user=> (m 2)
> nil
> user=> m
> {1 1, 1 2, 1 3}
>
> So I went ahead and opened an issue for 
> that:http://code.google.com/p/clojure/issues/detail?id=83
>

Please don't create issues without getting a nod from me here first.

These are bugs in user code. Map literals are in fact read as maps, so
a literal map with duplicate keys isn't going to produce an evaluated
map with distinct keys. If you create an array map with duplicate
keys, bad things will happen.

I'm not sure I want to slow down array-map in order to add the check.

Rich

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to