mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added (char-upcase)
This commit is contained in:
parent
8be0c02a06
commit
11d861a97c
1 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,13 @@
|
|||
(define (char>? c1 c2 . cs) (Cyc-bin-op-char > c1 (cons c2 cs)))
|
||||
(define (char<=? c1 c2 . cs) (Cyc-bin-op-char <= c1 (cons c2 cs)))
|
||||
(define (char>=? c1 c2 . cs) (Cyc-bin-op-char >= c1 (cons c2 cs)))
|
||||
(define (char-upcase c)
|
||||
(if (char-lower-case? c)
|
||||
(integer->char
|
||||
(- (char->integer c)
|
||||
(- (char->integer #\a)
|
||||
(char->integer #\A))))
|
||||
c))
|
||||
(define (char-alphabetic? c) (and (char>=? c #\A) (char<=? c #\z))) ;; ASCII-only
|
||||
(define (char-upper-case? c) (and (char>=? c #\A) (char<=? c #\Z))) ;; ASCII-only
|
||||
(define (char-lower-case? c) (and (char>=? c #\a) (char<=? c #\z))) ;; ASCII-only
|
||||
|
|
Loading…
Add table
Reference in a new issue