Skip to content

Instantly share code, notes, and snippets.

@ifesdjeen
Created May 9, 2013 11:27
Show Gist options
  • Save ifesdjeen/5546938 to your computer and use it in GitHub Desktop.
Save ifesdjeen/5546938 to your computer and use it in GitHub Desktop.
Non-confusing contains? function for vectors
(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