Skip to content

Instantly share code, notes, and snippets.

@syou6162
Created August 17, 2012 00:46
Show Gist options
  • Save syou6162/3374873 to your computer and use it in GitHub Desktop.
Save syou6162/3374873 to your computer and use it in GitHub Desktop.
(defprotocol Contains?
(contains? [this item]))
(extend-type clojure.lang.PersistentList
Contains?
(contains? [this item]
(some #(= % item) this)))
(contains? '(1 2 3) 1) ; true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment