Skip to content

Instantly share code, notes, and snippets.

@Raynes
Forked from bitemyapp/gist:6643575
Last active December 23, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynes/6643618 to your computer and use it in GitHub Desktop.
Save Raynes/6643618 to your computer and use it in GitHub Desktop.
(defn ?assoc-transform
"(?assoc-transform {:a 1} :a 2 sequential? vector) => {:a [1 2]}"
[m k v test transform]
(let [val (m k)]
(assoc m k
(if-let [okay (test val)]
v
(transform val v)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment