1.2.0 permalink Arrow_down_16x16
  • (reductions f coll)
  • (reductions f init coll)
DEPRECATED. Prefer clojure.core version.
Returns a lazy seq of the intermediate values of the reduction (as
per reduce) of coll by f, starting with init.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/seq_utils.clj:121 top

(defn reductions
  "DEPRECATED. Prefer clojure.core version.
  Returns a lazy seq of the intermediate values of the reduction (as
  per reduce) of coll by f, starting with init."
  {:deprecated "1.2"}
  ([f coll]
   (if (seq coll)
     (rec-seq self (cons (first coll) (map f self (rest coll))))
     (cons (f) nil)))
  ([f init coll]
   (rec-seq self (cons init (map f self coll)))))
Vars in clojure.contrib.seq-utils/reductions: cons defn first map reductions rest seq
Used in 0 other vars

Comments top

No comments for reductions. Log in to add a comment.