repeatedly

functionsince v0.0-927 clojure.core/repeatedlyEdit
(repeatedly f)
(repeatedly n f)

Details:

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


See Also:


Source docstring:
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
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn repeatedly
  ([f] (lazy-seq (cons (f) (repeatedly f))))
  ([n f] (take n (repeatedly f))))