41 lines
833 B
Plaintext
41 lines
833 B
Plaintext
If we eliminate char from HtDP/I, we need to add re-think the following
|
|
functions:
|
|
|
|
integer->char -- 1string version
|
|
|
|
char->integer -- 1string version
|
|
|
|
string->list -- explode
|
|
|
|
list->string -- implode
|
|
|
|
char-numeric? -- in a sense string->number is enough
|
|
(number? (string->number s))
|
|
|
|
char-alphabetic? --
|
|
(andmap (lambda (c)
|
|
(or (string<=? "A" x "Z") (string<=? "a" x "z")))
|
|
(string->list s))
|
|
|
|
char-whitespace? -- (andmap char-whitespace? s)
|
|
|
|
char-upper-case? -- (string<=? "A" x "Z")
|
|
|
|
char-lower-case? -- (string<=? "a" x "z")
|
|
|
|
char-upcase string-upcase
|
|
|
|
char-downcase string-downcase
|
|
|
|
make-string : Nat Char -> String
|
|
Nat String1 -> String
|
|
|
|
string : Char ... -> String
|
|
delete, string-append is enough
|
|
|
|
string-ref : String Nat -> Char
|
|
ith
|
|
|
|
NOTE:
|
|
substring consumes 2 or 3 arguments
|