Skip to content

clojure.core/doall

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 4 Runnable: 0
([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. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time.

Examples

by dakrone on . May have evaluation errors.
by gdeer81 on . May have evaluation errors.
by chbrown on . May have evaluation errors.
by elect000 on . May have evaluation errors.

Note by johnnyluu

Shouldn't we use seq instead of coll in the function signature since we should really pass a sequence?

Note by zephjc

'seq' is a function; using it in the function args as a value would shadow the function (and thereby making the function seq unusable in that scope)

See also


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