How to get a clojure array-map to maintain insertion order after assoc?
问题 I have an array-map which I am assoc ing some values into it. After a certain size the returned value is a PersistentHashMap rather than the original PersistentArrayMap . I've read about this behavior on a few web sites. Is there any way to force the insertion order even after assoc ? I do have a separate function which will take a ash-map and a vector of keys, and return a "fresh" array-map with keys in this order, but it means that for each assoc, I have to extract the keys first, cons/conj