Re: What does this all mean?
Per Bothner 18 Jul 2016 00:49 UTC
On 07/17/2016 04:46 PM, Jim Rees wrote:
> On Sun, Jul 17, 2016 at 6:30 PM, Per Bothner <xxxxxx@bothner.com <mailto:xxxxxx@bothner.com>> wrote:
> What about (string-repeat N S) or (string-repeat S N), where S is either a string
> or a character? Does either procedure conflict with any prior art?
>
>
> SRFI-13 xsubstring and SRFI-135 textual-replicate -- aka. SRFI-140 string-replicate -- would be the closest I can I come up with. Their required arguments would make them an inconvenient replacement though, so string-repeat seems appropriate.
It seems reasonable to have both string-replicate and also string-repeat as
a convenience function:
(define (string-repeat S N)
(let ((T (if (character? S) (string S) S)))
(string-replicate T 0 (* N (string-length T))))
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/