(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)
--
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