Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread Michał Marczyk
rsistentHashMap)]} >>> >>> And "get-distinct" has the same restriction, but in get-distinct I get >>> this error: >>> >>> java.lang.AssertionError: Assert failed: (= (type %) >>> clojure.lang.PersistentHashMap) >>> at admin.con

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread Michał Marczyk
.clj:40) >> >> The :post condition of "fetch" does not throw an error, so I know that >> "fetch" is returning clojure.lang.PersistentHashMap. However, when I print >> the return type of get-distinct, I am amazed to see that it is now >> clojure.lang.Persis

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread seancorfield
fetch" is returning clojure.lang.PersistentHashMap. However, when I print the return type of get-distinct, I am amazed to see that it is now clojure.lang.PersistentArrayMap. This function does almost nothing, so I am surprised it changes the concrete implementation type of the return value.

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread larry google groups
The :post condition of "fetch" does not throw an error, so I know that > "fetch" is returning clojure.lang.PersistentHashMap. However, when I print > the return type of get-distinct, I am amazed to see that it is > now clojure.lang.PersistentArrayMap. This fun

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread larry google groups
voke(controller.clj:40) The :post condition of "fetch" does not throw an error, so I know that "fetch" is returning clojure.lang.PersistentHashMap. However, when I print the return type of get-distinct, I am amazed to see that it is now clojure.lang.PersistentArrayMap. This fun

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-23 Thread Cedric Greevey
)) >> >> Both of these functions return lazyseqs, as expected. The results from >> both get run through a (reduce) function that does some minor filtering. >> Yet in one case the return type (from the reduce function) is >> clojure.lang.PersistentArrayMap >>

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-22 Thread larry google groups
et in one case the return type (from the reduce function) > is clojure.lang.PersistentArrayMap and in the other it > is clojure.lang.PersistentHashMap. I'd like to be able to write a :post > condition that enforces strictness, but that seems impossible because I can > not figure out wha

Re: When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-22 Thread larry google groups
filtering. Yet in one case the return type (from the reduce function) is clojure.lang.PersistentArrayMap and in the other it is clojure.lang.PersistentHashMap. I'd like to be able to write a :post condition that enforces strictness, but that seems impossible because I can not figure out what the

When does clojure.lang.PersistentArrayMap become clojure.lang.PersistentHashMap

2013-12-22 Thread larry google groups
I am surprised that a map literal is clojure.lang.PersistentArrayMap but as soon as I assign it to a var, it becomes clojure.lang.PersistentHashMap. Are there any rules for being able to predict when these conversions occur? user> (type {}) clojure.lang.PersistentArrayMap user> (type

Re: clojure.lang.PersistentArrayMap

2010-06-01 Thread Laurent PETIT
woops, merge is indeed the function you're after 2010/6/2 Laurent PETIT > Hi, > > 2010/6/1 Ryan > >> I have the following >> >> user=> (class ({:one "1"} {:two "2"} {:three "3"})) >> clojure.lang.PersistentArrayMap

Re: clojure.lang.PersistentArrayMap

2010-06-01 Thread Laurent PETIT
Hi, 2010/6/1 Ryan > I have the following > user=> (class ({:one "1"} {:two "2"} {:three "3"})) > clojure.lang.PersistentArrayMap > > but am a little confused as to how best to access the data > > for example: > user=> (count ({:one &q

Re: clojure.lang.PersistentArrayMap

2010-06-01 Thread patrik karlin
theres a function called merge 2010/6/1 Ryan > I have the following > user=> (class ({:one "1"} {:two "2"} {:three "3"})) > clojure.lang.PersistentArrayMap > > but am a little confused as to how best to access the data > > for example: >

clojure.lang.PersistentArrayMap

2010-06-01 Thread Ryan
I have the following user=> (class ({:one "1"} {:two "2"} {:three "3"})) clojure.lang.PersistentArrayMap but am a little confused as to how best to access the data for example: user=> (count ({:one "1"} {:two "2"} {:three "3"})