Last active
March 21, 2016 14:08
-
-
Save w33tmaricich/732b76e9a6dcd741d69c to your computer and use it in GitHub Desktop.
clj: retrieves the first key that has the associated value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn key-with-value¬ | |
"Retrieves the first key that has the associated value" | |
[list-items value] | |
(first (filter (comp #{value} list-items) (keys list-items)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment