Daniel Werner
unread,Nov 11, 2009, 8:19:11 AM11/11/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clojure
(doc some) says:
"... this will return true if :fred is in the sequence, otherwise nil:
(some #{:fred} coll)"
However, some returns the matching value instead:
=> (some #{:fred} [:foo :fred :ethel])
:fred
Attached patch fixes the docstring. (Not that applying the patch would
be any easier than fixing it by hand :-)
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index d20e10a..9c07409 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -1717,7 +1717,7 @@
(defn some
"Returns the first logical true value of (pred x) for any x in
coll,
else nil. One common idiom is to use a set as pred, for example
- this will return true if :fred is in the sequence, otherwise nil:
+ this will return :fred if :fred is in the sequence, otherwise nil:
(some #{:fred} coll)"
[pred coll]
(when (seq coll)