Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| (ns ring.util.data | |
| "Miscellaneous functions for manipulating data structures.") | |
| (defn assoc+ | |
| "Associate a key with a value in a map. If the key already exists in the map, | |
| a vector of values is associated with the key." | |
| [map key val] | |
| (assoc map key | |
| (if-let [cur (get map key)] | |
| (if (vector? cur) | |
| (conj cur val) | |
| [cur val]) | |
| val))) |