diff --git a/lib/chibi/string.sld b/lib/chibi/string.sld index 4c13ab28..dc717165 100644 --- a/lib/chibi/string.sld +++ b/lib/chibi/string.sld @@ -61,7 +61,17 @@ (define (string-cursor-prev s i) (- i 1)) (define (substring-cursor s start . o) (substring s start (if (pair? o) (car o) (string-length s)))) - (define (string-concatenate ls) (apply string-append ls)) + (define (string-concatenate orig-ls . o) + (let ((sep (if (pair? o) (car o) "")) + (out (open-output-string))) + (let lp ((ls orig-ls)) + (cond + ((pair? ls) + (if (and sep (not (eq? ls orig-ls))) + (write-string sep out)) + (write-string (car ls) out) + (lp (cdr ls))))) + (get-output-string out))) (define string-size string-length) (define (call-with-output-string proc) (let ((out (open-output-string)))