From 9200439c268375dba6fb1077ef5c86667f3edf26 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 28 Mar 2016 22:38:50 -0400 Subject: [PATCH] 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. --- scheme/char.sld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheme/char.sld b/scheme/char.sld index 5b0d7eb5..dc3c6186 100644 --- a/scheme/char.sld +++ b/scheme/char.sld @@ -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)))