PR 6393
svn: r8391
This commit is contained in:
parent
18a3e03e9b
commit
b3007d9088
|
@ -22,13 +22,15 @@
|
|||
glob->regexp)
|
||||
|
||||
|
||||
(define ((make-string-do! translate) s)
|
||||
(define ((make-string-do! translate who) s)
|
||||
(if (and (string? s) (not (immutable? s)))
|
||||
(let loop ([n (sub1 (string-length s))])
|
||||
(unless (negative? n)
|
||||
(string-set! s n (translate (string-ref s n)))
|
||||
(loop (sub1 n)))))
|
||||
(define string-lowercase! (make-string-do! char-downcase))
|
||||
(define string-uppercase! (make-string-do! char-upcase))
|
||||
(loop (sub1 n))))
|
||||
(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
|
||||
(define-syntax wrap-errors
|
||||
|
|
Loading…
Reference in New Issue
Block a user