Debian Codegraph @

%3a14/srfi-14-char-sets.scm

raw symbols SCIP
1 ; Part of Scheme 48 1.9. See file COPYING for notices and license.
2
3 ; Authors: Mike Sperber
4
5 ; This constructs the SRFI 14 char sets from thin air and what's defined in
6 ; srfi-14-base-char-sets.scm.
7
8 ; Defined there:
9 ; lower-case, upper-case, title-case, letter, digit, punctuation, symbol
10
11 (define char-set:empty (char-set))
12 (define char-set:full (char-set-complement char-set:empty))
13
14 (define char-set:letter+digit
15 (char-set-union char-set:letter char-set:digit))
16
17 (define char-set:graphic
18 (char-set-union char-set:mark
19 char-set:letter
20 char-set:digit
21 char-set:symbol
22 char-set:punctuation))
23
24 (define char-set:whitespace
25 (char-set-union char-set:separator
26 (list->char-set (map scalar-value->char
27 '(9 ; tab
28 10 ; newline
29 11 ; vtab
30 12 ; page
31 13 ; return
32 )))))
33
34
35 (define char-set:printing
36 (char-set-union char-set:whitespace char-set:graphic))
37
38 (define char-set:iso-control
39 (char-set-union (ucs-range->char-set 0 #x20)
40 (ucs-range->char-set #x7f #xa0)))
41
42 (define char-set:blank
43 (char-set-union char-set:space-separator
44 (char-set (scalar-value->char 9)))) ; tab
45
46 (define char-set:ascii (ucs-range->char-set 0 128))
47 (define char-set:hex-digit (string->char-set "0123456789abcdefABCDEF"))
48
49 (make-char-set-immutable! char-set:empty)
50 (make-char-set-immutable! char-set:full)
51 (make-char-set-immutable! char-set:lower-case)
52 (make-char-set-immutable! char-set:upper-case)
53 (make-char-set-immutable! char-set:letter)
54 (make-char-set-immutable! char-set:digit)
55 (make-char-set-immutable! char-set:hex-digit)
56 (make-char-set-immutable! char-set:letter+digit)
57 (make-char-set-immutable! char-set:punctuation)
58 (make-char-set-immutable! char-set:symbol)
59 (make-char-set-immutable! char-set:graphic)
60 (make-char-set-immutable! char-set:whitespace)
61 (make-char-set-immutable! char-set:printing)
62 (make-char-set-immutable! char-set:blank)
63 (make-char-set-immutable! char-set:iso-control)
64 (make-char-set-immutable! char-set:ascii)