On Thu, Feb 28, 2013 at 11:59 PM, Michael Gardner <gardne...@gmail.com>wrote:

> This is a sore spot that has been discussed many times on this list[1].
> The short version is that many people agree that the name "contains?" is
> misleading to newcomers, but according to Rich it's not changing any time
> soon[2]. What you want for linear searches is 'some (as mentioned in the
> doc for 'contains?).
>
> Also, why are you quoting your vectors (e.g. '[:a :b :c] instead of just
> [:a :b :c])?
>
I accidentally quoted those in my repl tries and I ended up recalling the
last variant (Ctrl+Up in repl) when I tried the 1 3 2 params.

>
> [1] Most recently,
> https://groups.google.com/d/msg/clojure/wNFdG11zMMo/OC9ezSn9nRAJ
> [2] https://groups.google.com/d/msg/clojure/bSrSb61u-_8/3-wjAkJ4VJgJ
>
Thank you for the links Michael.

"
Ambrose Bonnaire-Sergeant
9/3/12
  'contains?' tests if a key is in a collection.

Vector is an associative data structure, with keys being indexes.
A vector of length 3 has the key 2, but not key 3.
"

According to this, can a vector have keys that are not numbers? like :a ,
if not, then wouldn't it make more sense that
(contains? [:a :b :c] :a)  would throw ? It's probably just me.

Thanks.



>
>
--
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to