From 31278c016abbe46503550c7aa26be923bec01895 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 14 Oct 2012 22:52:16 +0900 Subject: [PATCH] string-copy now takes start/end arguments --- lib/init-7.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/init-7.scm b/lib/init-7.scm index 14c10130..8032c527 100644 --- a/lib/init-7.scm +++ b/lib/init-7.scm @@ -1097,15 +1097,16 @@ (define (string-cursor-start s) 0) +(define (string-copy str . o) + (apply substring str (if (pair? o) o '(0)))) + (cond-expand (full-unicode - (define (string-copy s) (substring-cursor s 0 (string-size s))) (define string-cursor-end string-size)) (else (define (string-index->offset str i) i) (define string-size string-length) (define substring-cursor substring) - (define (string-copy s) (substring s 0 (string-length s))) (define string-cursor-end string-length) (define string-cursor-ref string-ref) (define (string-cursor-next s i) (+ i 1))