Character operations as the Char class.
ASCII only. Classification, case conversion, and comparison homed on the Char class.
Char(Char ->int c)The integer code point of a character.
Parameters:
CHARACTER — CharacterReturns: INTEGER — Code point (0-255 for ASCII/byte chars)
Examples:
(Char ->int #\A) => 65(Char from-int n)The character for an integer code point.
Parameters:
INTEGER — Integer code pointReturns: CHARACTER — The character
Examples:
(Char from-int 97) => #\a(Char alphabetic? c)Test whether a character is alphabetic.
Parameters:
CHARACTER — Character to testReturns: BOOL — True if c is a letter A-Z or a-z
Examples:
(Char alphabetic? #\q) => #t
(Char alphabetic? #\7) => #f(Char numeric? c)Test whether a character is a digit.
Parameters:
CHARACTER — Character to testReturns: BOOL — True if c is a digit 0-9
Examples:
(Char numeric? #\7) => #t(Char whitespace? c)Test whether a character is whitespace (space, tab, newline, CR, FF).
Parameters:
CHARACTER — Character to testReturns: BOOL — True if c is whitespace
Examples:
(Char whitespace? #\space) => #t
(Char whitespace? #\a) => #f(Char upper-case? c)Test whether a character is uppercase.
Parameters:
CHARACTER — Character to testReturns: BOOL — True if c is uppercase A-Z
Examples:
(Char upper-case? #\A) => #t(Char lower-case? c)Test whether a character is lowercase.
Parameters:
CHARACTER — Character to testReturns: BOOL — True if c is lowercase a-z
Examples:
(Char lower-case? #\A) => #f(Char upcase c)Convert a character to uppercase.
Parameters:
CHARACTER — Character to convertReturns: CHARACTER — Uppercase version of c, or c unchanged
Examples:
(Char upcase #\a) => #\A
(Char upcase #\1) => #\1(Char downcase c)Convert a character to lowercase.
Parameters:
CHARACTER — Character to convertReturns: CHARACTER — Lowercase version of c, or c unchanged
Examples:
(Char downcase #\A) => #\a(Char =? a b)Test whether two characters are equal.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if characters are equal
Examples:
(Char =? #\a #\a) => #t(Char <? a b)Test whether a character is less than another by code point.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a comes before b
Examples:
(Char <? #\a #\b) => #t(Char >? a b)Test whether a character is greater than another by code point.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a comes after b
Examples:
(Char >? #\a #\b) => #f(Char <=? a b)Test whether a character is less than or equal to another.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a is equal to or comes before b
Examples:
(Char <=? #\a #\a) => #t(Char >=? a b)Test whether a character is greater than or equal to another.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a is equal to or comes after b
Examples:
(Char >=? #\a #\b) => #f(Char ci=? a b)Case-insensitive character equality.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if characters are equal ignoring case
Examples:
(Char ci=? #\a #\A) => #t(Char ci<? a b)Case-insensitive character less-than.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a < b ignoring case
Examples:
(Char ci<? #\a #\B) => #t(Char ci>? a b)Case-insensitive character greater-than.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a > b ignoring case
Examples:
(Char ci>? #\b #\A) => #t(Char ci<=? a b)Case-insensitive character less-than-or-equal.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a <= b ignoring case
Examples:
(Char ci<=? #\A #\a) => #t(Char ci>=? a b)Case-insensitive character greater-than-or-equal.
Parameters:
CHARACTER — First characterCHARACTER — Second characterReturns: BOOL — True if a >= b ignoring case
Examples:
(Char ci>=? #\a #\B) => #f