Associate a key with a value. If the key already exists in the map,
create a vector of values.
(defn assoc-param
"Associate a key with a value. If the key already exists in the map,
create a vector of values."
[map key val]
(assoc map key
(if-let [cur (map key)]
(if (vector? cur)
(conj cur val)
[cur val])
val)))
Comments top
No comments for assoc-param. Log in to add a comment.