On 3 Kwi, 07:37, Andreas Kostler <[email protected]>
wrote:
> Hi Daniel,
> Thanks for your reply. I know how to get to :fred.
> I'm just wondering why some wouldn't work on maps.
Well, `some' finds an element in a seq that satisfies the given
predicate, and seq'ing a map will get you a sequence of key/value
pairs. So, using a set as a predicate, you could test whether a given
key/value pair exists in a map:
(some #{[:barney "rubble"]} {:fred "flinstone" :barney "rubble"})
So it does work on maps, albeit not in the way you'd expect it to.
Daniel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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