implement string-append in C

This commit is contained in:
Yuichi Nishiwaki
2014-02-09 02:42:50 +09:00
parent 7187e4e982
commit 39af5ca254
2 changed files with 24 additions and 8 deletions
-8
View File
@@ -476,14 +476,6 @@
(string-copy! res 0 v start end)
res)))
(define (string-append . vs)
(define (string-append-2-inv w v)
(let ((res (make-string (+ (string-length v) (string-length w)))))
(string-copy! res 0 v)
(string-copy! res (string-length v) w)
res))
(fold string-append-2-inv #() vs))
(define (string-fill! v fill . opts)
(let ((start (if (pair? opts) (car opts) 0))
(end (if (>= (length opts) 2)