Skip to content

Instantly share code, notes, and snippets.

@Reder
Created March 22, 2013 21:42
Show Gist options
  • Save Reder/5224997 to your computer and use it in GitHub Desktop.
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.
(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