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