mes: Add char-set:digit, char-set:lower-case, char-set:upper-case.

* mes/module/srfi/srfi-14.mes (char-set:digit, char-set:lower-case,
char-set:upper-case): New variable.
This commit is contained in:
Jan Nieuwenhuizen 2018-11-11 10:09:41 +01:00
parent b9534cb287
commit b7f5e1a8f9
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 14 additions and 0 deletions

View File

@ -36,6 +36,20 @@
(equal? a b)))
(define char-set:whitespace (char-set #\tab #\page #\return #\vtab #\newline #\space))
(define char-set:digit (apply char-set
(map integer->char
(map (lambda (i)
(+ i (char->integer #\0))) (iota 10)))))
(define char-set:lower-case (apply char-set
(map integer->char
(map (lambda (i)
(+ i (char->integer #\a))) (iota 26)))))
(define char-set:upper-case (apply char-set
(map integer->char
(map (lambda (i)
(+ i (char->integer #\A))) (iota 26)))))
(define (list->char-set lst)
(apply char-set lst))