Test whether a list contains a specific value in Clojure

后端 未结 18 2248
自闭症患者
自闭症患者 2020-11-30 17:17

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:

18条回答
  •  渐次进展
    2020-11-30 17:58

    I know that I'm a little bit late, but what about:

    (contains? (set '(101 102 103)) 102)
    

    At last in clojure 1.4 outputs true :)

提交回复
热议问题