On Fri, 25 Jun 2010 15:36:31 +0200 Michael Wood <esiot...@gmail.com> wrote:
> On 25 June 2010 12:27, Tim Robinson <tim.blacks...@gmail.com> wrote: > > I tried Clojure via Githhub today. > > > > Anyone notice this bug that hadn't existed in Version 1.1 > > > > user=> #{:item1 {:a "A" :b "B"} :item2 {:a "A" :b "B"}} > > java.lang.IllegalArgumentException: Duplicate key: {:a "A", :b "B"} > > You're trying to put duplicate values into a set. So? Most places, putting a value that's already in a set into the set is a nop. Even in clojure that exhibits the above behavior: user=> #{:a :a} java.lang.IllegalArgumentException: Duplicate key: :a user=> (set [:a :a]) #{:a} user=> (conj #{:a} :a) #{:a} user=> Apparently, duplicate keys in sets are only disallowed in set literals. Arguably, that must be a mistake on the users part, but it sure seems to clash with the behavior of sets elsewhere. <mike -- Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org -- 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 Note that posts from new members are moderated - please be patient with your first post. 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