mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 05:06:37 +02:00
string-copy now takes start/end arguments
This commit is contained in:
parent
4d10734110
commit
31278c016a
1 changed files with 3 additions and 2 deletions
|
@ -1097,15 +1097,16 @@
|
||||||
|
|
||||||
(define (string-cursor-start s) 0)
|
(define (string-cursor-start s) 0)
|
||||||
|
|
||||||
|
(define (string-copy str . o)
|
||||||
|
(apply substring str (if (pair? o) o '(0))))
|
||||||
|
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(full-unicode
|
(full-unicode
|
||||||
(define (string-copy s) (substring-cursor s 0 (string-size s)))
|
|
||||||
(define string-cursor-end string-size))
|
(define string-cursor-end string-size))
|
||||||
(else
|
(else
|
||||||
(define (string-index->offset str i) i)
|
(define (string-index->offset str i) i)
|
||||||
(define string-size string-length)
|
(define string-size string-length)
|
||||||
(define substring-cursor substring)
|
(define substring-cursor substring)
|
||||||
(define (string-copy s) (substring s 0 (string-length s)))
|
|
||||||
(define string-cursor-end string-length)
|
(define string-cursor-end string-length)
|
||||||
(define string-cursor-ref string-ref)
|
(define string-cursor-ref string-ref)
|
||||||
(define (string-cursor-next s i) (+ i 1))
|
(define (string-cursor-next s i) (+ i 1))
|
||||||
|
|
Loading…
Add table
Reference in a new issue