sorted-map-by

functionsince v0.0-1211 clojure.core/sorted-map-byEdit
(sorted-map-by comparator & keyvals)

Details:

Returns a new sorted map with supplied mappings, using the supplied comparator function.

keyvals must be an even number of forms.


See Also:


Source docstring:
keyval => key val
Returns a new sorted map with supplied mappings, using the supplied comparator.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn sorted-map-by
  ([comparator & keyvals]
     (loop [in (seq keyvals)
            out (PersistentTreeMap. (fn->comparator comparator) nil 0 nil 0)]
       (if in
         (recur (nnext in) (assoc out (first in) (second in)))
         out))))