What is the best way to test whether a list contains a given value in Clojure?
In particular, the behaviour of contains? is currently confusing me:
contains?
The recommended way is to use some with a set - see documentation for clojure.core/some.
some
clojure.core/some
You could then use some within a real true/false predicate, e.g.
(defn in? [coll x] (if (some #{x} coll) true false))