(priority-map-by comparator & keyvals)
Usage: (priority-map comparator key val key val ...)
Returns a new priority map with custom comparator and optional supplied mappings.
(priority-map-by comparator) yields an empty priority map with custom comparator.
Source
(defn priority-map-by
"Usage: (priority-map comparator key val key val ...)
Returns a new priority map with custom comparator and optional supplied mappings.
(priority-map-by comparator) yields an empty priority map with custom comparator."
[comparator & keyvals]
{:pre [(even? (count keyvals))]}
(reduce conj (pm-empty-by comparator) (partition 2 keyvals)))