HTTPS clone URL

Subversion checkout URL

PersistentArrayMap and PersistentHashSet
literals. cljs.core.PersistentArrayMap/fromArray now only takes on
array of KV pairs, and boolean flag no-clone. Compiler emits array map
literals with this set to true to avoid copy overhead.
PersistentArrayMap now calls through protocols on hash-map.
PersistentHashSet now starts with PersistentArrayMap underneath
instead of PersistentHashMap. PersistentHashSet now also takes an
array, if this array is less that threshold / 2 for
PersistentArrayMaps we just pass it along, again using the no-clone
trick. If larger than threshold we use transient PersistentHashSet.
Finally performance enhancement for hash-set. If we get an IndexedSeq,
which we will in the case of (hash-set 1 2 3) etc, we construct an
array and call cljs.core.PersistentHashSet/fromArray.

This no longer creates only "hash" sets. Shouldn't there be an array-set function? We could rename this function to set* in the spirit of list its the signature variation list*.

Similar complaint applies to cljs.core.PersistentHashSet/fromArray.

Going slightly off topic: We need a generic factory function for maps too. Unfortunate that the word "map" is overloaded. Maybe make-map? Although people already use hash-map all over, maybe more apps would be better served by going the opposite direction and converting hash-map to be a generic factory function :-/

Honestly: It's only really useful for people like you and me so we can test particular implementations without having to do battle with internal heuristics. It's not really convenient to call constructors directly, since they often have extra fields.

Honestly, I wish we could push each data structure into it's own namespace and keep its helper functions and factory functions tucked away there. I'm all for taking array-map out of core. I just want some consistency between sets and maps and their backing implementations. JVM Clojure's data structures live in clojure.lang, maybe we should do something similar for ClojureScript?

This no longer creates only "hash" sets. Shouldn't there be an array-set function? We could rename this function to set* in the spirit of list its the signature variation list*.

Similar complaint applies to cljs.core.PersistentHashSet/fromArray.

Going slightly off topic: We need a generic factory function for maps too. Unfortunate that the word "map" is overloaded. Maybe make-map? Although people already use hash-map all over, maybe more apps would be better served by going the opposite direction and converting hash-map to be a generic factory function :-/

Honestly: It's only really useful for people like you and me so we can test particular implementations without having to do battle with internal heuristics. It's not really convenient to call constructors directly, since they often have extra fields.

Honestly, I wish we could push each data structure into it's own namespace and keep its helper functions and factory functions tucked away there. I'm all for taking array-map out of core. I just want some consistency between sets and maps and their backing implementations. JVM Clojure's data structures live in clojure.lang, maybe we should do something similar for ClojureScript?