Skip to content

clojure.core/repeatedly

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 5 Runnable: 3
([f] [n f])

Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it

Examples

by gstamp on
by Jeff Rose on
by Jjunior130 on
by reborg on . May have evaluation errors.
by loeschzwerg on . May have evaluation errors.

Note by boxie

if the function you want to repeat doesn't have side effects and has an argument, 'iterate' may be what you are looking for.

See also


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