In Ruby, \"str\" * 3 will give you \"strstrstr\". In Clojure, the closest I can think of is (map (fn [n] \"str\") (range 3)) Is there a more idioma
I wouldn't claim this is idiomatic, but it is also possible to repeat a string using the clojure cl-format function which clojure inherited from common lisp. Common lisp in turn transplanted it from FORTRAN which came up with this piece of work in the 50s.
And here we are in 2018...
Example:
user=> (cl-format nil "~v@{~a~:*~}" 5 "Bob")
"BobBobBobBobBob"
The format string works as follows:
~5@{ where the five is pulled from the argument list since there is a v in front of the @. the ~5@{ in turn means iterate 5 times using the entire argument list (the string "Bob") as the iterable. ~}), we print the string "Bob" with ~a and then "move the argument pointer" back one position using the ~:* construct so that we can "consume" the argument "Bob" again. Voila, 5 repetitions of Bob.
It should be noted that cl-format can either return the produced string (if the second argument is nil), print it to the current *out* (if the second argument is true), or print it to a writer (if the second argument is a writer).
For the all too gory details on the format string syntax you can refer to:
Formatted Output to Character Streams
in the common lisp the language reference and possibly to:
Eliminating format from lisp
for why it could be argued that cl-format is a bad idea.