PR 6393
svn: r8391
This commit is contained in:
parent
18a3e03e9b
commit
b3007d9088
|
@ -22,13 +22,15 @@
|
||||||
glob->regexp)
|
glob->regexp)
|
||||||
|
|
||||||
|
|
||||||
(define ((make-string-do! translate) s)
|
(define ((make-string-do! translate who) s)
|
||||||
(let loop ([n (sub1 (string-length s))])
|
(if (and (string? s) (not (immutable? s)))
|
||||||
(unless (negative? n)
|
(let loop ([n (sub1 (string-length s))])
|
||||||
(string-set! s n (translate (string-ref s n)))
|
(unless (negative? n)
|
||||||
(loop (sub1 n)))))
|
(string-set! s n (translate (string-ref s n)))
|
||||||
(define string-lowercase! (make-string-do! char-downcase))
|
(loop (sub1 n))))
|
||||||
(define string-uppercase! (make-string-do! char-upcase))
|
(raise-type-error who "mutable string" s)))
|
||||||
|
(define string-lowercase! (make-string-do! char-downcase 'string-lowercase!))
|
||||||
|
(define string-uppercase! (make-string-do! char-upcase 'string-uppercase!))
|
||||||
|
|
||||||
;; helpers for eval-string and read-from-string-one-or-all
|
;; helpers for eval-string and read-from-string-one-or-all
|
||||||
(define-syntax wrap-errors
|
(define-syntax wrap-errors
|
||||||
|
|
Loading…
Reference in New Issue
Block a user