Re: Problems with map of empty collections

2012-04-05 Thread Leif
I'd also like to know if there is a way to construct a Map or Set that differentiates lists and vectors. To try to answer your question, Juan, I think it's because of the `clojure.core/=` semantics. From the docstring: "compares numbers and collections in a type-independent manner." So, user>

Re: Problems with map of empty collections

2012-04-03 Thread Stuart Campbell
I think quoting plays a part here: Clojure 1.3.0 user=> {(list 1 2 3) :list [1 2 3] :vec} IllegalArgumentException Duplicate key: (1 2 3) clojure.lang.PersistentArrayMap.createWithCheck (PersistentArrayMap.java:70) Stuart On 3 April 2012 22:41, JuanManuel Gimeno Illa wrote: > More examples in

Re: Problems with map of empty collections

2012-04-03 Thread JuanManuel Gimeno Illa
More examples in clojure 1.3.0: user=> {[1 2 3] :vector '(1 2 3) :list} {[1 2 3] :list} but user=> #{[1 2 3] (1 2 3)} IllegalArgumentException Duplicate key: (1 2 3) clojure.lang.PersistentHashSet.createWithCheck (PersistentHashSet.java:68) ... anyone has an explanation? Juan Manuel On Tue

Re: Problems with map of empty collections

2012-04-03 Thread mnicky
Another interesting fact is that: Clojure 1.2.1 user=> {'(1) :list [1] :vector} java.lang.IllegalArgumentException: Duplicate key: (1) (NO_SOURCE_FILE:0) Clojure 1.3.0 user=> {'(1) :list [1] :vector} {(1) :vector} Clojure 1.4.0-beta1 user=> {'(1) :list [1] :vector} {(1) :vector} ...but I don't

Problems with map of empty collections

2012-04-03 Thread JuanManuel Gimeno Illa
Playing with some problems of 4clojure, I wanted to make a map which, for each empty collection, returns a keyword. But it seems that it is impossible to have both an empty list and an empty vector in the same map. user=> {() :list} {() :list} user=> {() :list [] :vector} IllegalArgumentExceptio