Created
May 9, 2013 11:27
-
-
Save ifesdjeen/5546938 to your computer and use it in GitHub Desktop.
Non-confusing contains? function for vectors
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 vec-contains? | |
[vec value] | |
(not (nil? (some #(= value %) vec)))) | |
(vec-contains? ["a" "b" "c"] "a") ;; true | |
(vec-contains? ["a" "b" "c"] "e") ;; false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment