user=> (apply str (replicate 7 \space)) ; 7 spaces user=> (replicate 7 (rand-int 10)) (3 3 3 3 3 3 3) ; the same number
(defn replicate "Returns a lazy seq of n xs." {:added "1.0"} [n x] (take n (repeat x)))
Note that replicate is obsolete. It's functionality is now available via the two-arg arity form of repeat.
replicate
repeat
Comments top
1 comment(s) for replicate.
Note that
replicateis obsolete. It's functionality is now available via the two-arg arity form ofrepeat.