Bugfix for range of char-alphabetic?

There are ASCII chars between the upper and lower case chars. So, be smarter about checking for alphabetic chars.
This commit is contained in:
Justin Ethier 2016-03-28 22:38:50 -04:00
parent 9052a0d2bd
commit 9200439c26

View file

@ -38,7 +38,7 @@
(char->integer #\A))))
c))
; TODO: char-foldcase
(define (char-alphabetic? c) (and (char>=? c #\A) (char<=? c #\z))) ;; ASCII-only
(define (char-alphabetic? c) (or (char-upper-case? c) (char-lower-case? c)))
(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
(define (char-numeric? c) (member c '(#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)))