Skip to content

clojure.core/dorun

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 4 Runnable: 1
([coll] [n coll])

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.

Examples

by gstamp on . May have evaluation errors.
by devn on
by john.r.woodward on . May have evaluation errors.
by gdeer81 on . May have evaluation errors.

Note by finalfantasia

clojure.core/run! can take the place of (dorun (map ...)).

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.