On Jan 29, 2009, at 5:23 PM, Cosmin Stejerean wrote:
>
> If in? was to be added how would it behave when given a map as the
> first argument? I would rather have "contains?" do the right thing
> for list/vectors/sets and keep its current behavior for maps. If we
> do actually need a function like contains that ONLY accepts a map as
> the first argument I think a name like has-key? is the most intuitive.
>
I think "in?" would behave like "contains?" when given a map:
(in? {:a 1 :b 2 :c 3} :a) => true
(in? {:a 1 :b 2 :c 3} :d) => false
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---