mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 13:37:35 +02:00
smarter string-copy for utf8
This commit is contained in:
parent
8ca510bcb3
commit
c3fea1f765
1 changed files with 2 additions and 1 deletions
|
@ -415,7 +415,6 @@
|
||||||
|
|
||||||
(define (string . args) (list->string args))
|
(define (string . args) (list->string args))
|
||||||
(define (string-append . args) (string-concatenate args))
|
(define (string-append . args) (string-concatenate args))
|
||||||
(define (string-copy s) (substring s 0 (string-length s)))
|
|
||||||
|
|
||||||
(define (string=? s1 s2) (eq? (string-cmp s1 s2 #f) 0))
|
(define (string=? s1 s2) (eq? (string-cmp s1 s2 #f) 0))
|
||||||
(define (string<? s1 s2) (< (string-cmp s1 s2 #f) 0))
|
(define (string<? s1 s2) (< (string-cmp s1 s2 #f) 0))
|
||||||
|
@ -1027,8 +1026,10 @@
|
||||||
|
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(utf-8
|
(utf-8
|
||||||
|
(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-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