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
Just to throw some more awesome and hopefully thought-provoking solutions.
user=> (clojure.string/join (repeat 3 "str"))
"strstrstr"
user=> (format "%1$s%1$s%1$s" "str")
"strstrstr"
user=> (reduce str (take 3 (cycle ["str"])))
"strstrstr"
user=> (reduce str (repeat 3 "str"))
"strstrstr"
user=> (reduce #(.concat %1 %2) (repeat 3 "str"))
"strstrstr"