Re: Bug in transients: Cannot add more than 8 items to a transient map

2013-05-11 Thread Alan Malloy
Also, maps don't have an ordering, so the function is misguided by definition. You can use a sorted-map, if having the map's keys is very important to you, but generally it's just confusion that leads to wanting this in the first place. If you do decide the map must be sorted in a specific orde

Re: Bug in transients: Cannot add more than 8 items to a transient map

2013-05-11 Thread Andy Fingerhut
What you are attempting to do is sometimes called "bashing a transient in place". See these links for some discussion and examples: http://clojuredocs.org/clojure_core/clojure.core/assoc! http://clojuredocs.org/clojure_core/clojure.core/dissoc! Andy On Sat, May 11, 2013 at 3:51 PM, Wo

Bug in transients: Cannot add more than 8 items to a transient map

2013-05-11 Thread Wojciech Winogrodzki
Clojure 1.5.1. I'm trying to reorder a map. The keys in the map are known beforehand and their order is undefined. So, I'm taking this map and construct a new transient map with the keys ordered as I need them: defn reorder-map [] (let [ m {:j 10 :g 7 :b 2 :d 4 :e 5 :h 8 :i 9