Created
March 22, 2013 21:42
-
-
Save Reder/5224997 to your computer and use it in GitHub Desktop.
A way to get the key by a value in a Map. Though it makes more sense to use BiMap, but it should be a harder implementation.
This file contains 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 get-key-from-map [v m] | |
(key (first (filter #(-> % val (= v)) m)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment