summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2010-07-10 10:31:58 -0400
committerStuart Halloway <stu@thinkrelevance.com>2010-07-10 10:31:58 -0400
commitd184ed95817c5ddfd5874ea75e83e0df7e753c24 (patch)
tree7675fee44b0f086ff0e11bf89dda5ab0886b583a
parent07906aab47bdda48d11b56ef0395adb7bf13db43 (diff)
fix reduce metadata
-rw-r--r--src/clj/clojure/core.clj14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index fdfd37a8..ade4405c 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -770,7 +770,19 @@
[x] (. clojure.lang.Numbers (inc x)))
;; reduce is defined again later after InternalReduce loads
-(def reduce
+(def
+ ^{:arglists '([f coll] [f val coll])
+ :doc "f should be a function of 2 arguments. If val is not supplied,
+ returns the result of applying f to the first 2 items in coll, then
+ applying f to that result and the 3rd item, etc. If coll contains no
+ items, f must accept no arguments as well, and reduce returns the
+ result of calling f with no arguments. If coll has only 1 item, it
+ is returned and f is not called. If val is supplied, returns the
+ result of applying f to val and the first item in coll, then
+ applying f to that result and the 2nd item, etc. If coll contains no
+ items, returns val and f is not called."
+ :added "1.0"}
+ reduce
(fn r
([f coll]
(let [s (seq coll)]