dorun

functionsince v0.0-927 clojure.core/dorunEdit
(dorun coll)
(dorun n coll)

Details:

Forces evaluation of a lazy sequence. Often used to see the effects of a sequence produced via functions that have side effects.

dorun walks through the successive nexts of the sequence and returns nil.


See Also:


Source docstring:
When lazy sequences are produced via functions that have side
effects, any effects other than those needed to produce the first
element in the seq do not occur until the seq is consumed. dorun can
be used to force any effects. Walks through the successive nexts of
the seq, does not retain the head and returns nil.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn dorun
  ([coll]
   (when-let [s (seq coll)]
     (recur (next s))))
  ([n coll]
   (when (and (seq coll) (pos? n))
     (recur (dec n) (next coll)))))