(dotimes bindings & body)
bindings => name n
Repeatedly executes body (presumably for side-effects) with name
bound to integers from 0 through n-1.
Source
(defmacro dotimes
"bindings => name n
Repeatedly executes body (presumably for side-effects) with name
bound to integers from 0 through n-1."
{:added "1.0"}
[bindings & body]
(assert-args
(vector? bindings) "a vector for its binding"
(= 2 (count bindings)) "exactly 2 forms in binding vector")
(let [i (first bindings)
n (second bindings)]
`(let [n# (long ~n)]
(loop [~i 0]
(when (< ~i n#)
~@body
(recur (unchecked-inc ~i)))))))