Add a string_repeat builtin for repeating a string N times.
Proposed function
string_repeat(@String, @Nat -> @String) -- repeat string N times
Rationale
Building repeated patterns (padding, separators, indentation) currently requires recursive functions with manual string_concat calls. A dedicated builtin is simpler and more efficient.
Implementation notes
Allocate length * N bytes, copy the source string N times in a loop. Pure function.
Dependencies
Add a
string_repeatbuiltin for repeating a string N times.Proposed function
string_repeat(@String, @Nat -> @String)-- repeat string N timesRationale
Building repeated patterns (padding, separators, indentation) currently requires recursive functions with manual
string_concatcalls. A dedicated builtin is simpler and more efficient.Implementation notes
Allocate
length * Nbytes, copy the source string N times in a loop. Pure function.Dependencies