>From the book Clojure Programming <http://www.clojurebook.com/>, Page 101 :

*"It is a common mistake for Clojure programmers to initially believe that
> contains? always searches for the presence of a value in a collection, that
> is, that it would be appropriate to use to determine if the vector [0 1 2
> 3] contained a particular numeric value. This misconception can lead to
> some very confusing results:*
>
> *(contains? [1 2 3] 3)*
> *;= false*
>
> *(contains? [1 2 3] 2)*
> *;= true*
>
> *(contains? [1 2 3] 0)*
> *;= true*
>
> *Of course, the results above are correct, since contains? is only
> checking to see if any mapping exists for the provided key—in this case,
> the indices 3, 2, and 0. To check for the existence of a particular value
> in a collection, it is typical to use some*
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to