x-lang

← Index

x/type/char

Character operations as the Char class.

ASCII only. Classification, case conversion, and comparison homed on the Char class.

Class Char

(Char ->int c)

The integer code point of a character.

Parameters:

Returns: INT — Code point (0-255 for ASCII/byte chars)

(Char from-int n)

The character for an integer code point.

Parameters:

Returns: CHAR — The character

(Char alphabetic? c)

Test whether a character is alphabetic.

Parameters:

Returns: BOOL — True if c is a letter A-Z or a-z

(Char numeric? c)

Test whether a character is a digit.

Parameters:

Returns: BOOL — True if c is a digit 0-9

(Char whitespace? c)

Test whether a character is whitespace (space, tab, newline, CR, FF).

Parameters:

Returns: BOOL — True if c is whitespace

(Char upper-case? c)

Test whether a character is uppercase.

Parameters:

Returns: BOOL — True if c is uppercase A-Z

(Char lower-case? c)

Test whether a character is lowercase.

Parameters:

Returns: BOOL — True if c is lowercase a-z

(Char upcase c)

Convert a character to uppercase.

Parameters:

Returns: CHAR — Uppercase version of c, or c unchanged

(Char downcase c)

Convert a character to lowercase.

Parameters:

Returns: CHAR — Lowercase version of c, or c unchanged

(Char =? a b)

Test whether two characters are equal.

Parameters:

Returns: BOOL — True if characters are equal

(Char <? a b)

Test whether a character is less than another by code point.

Parameters:

Returns: BOOL — True if a comes before b

(Char >? a b)

Test whether a character is greater than another by code point.

Parameters:

Returns: BOOL — True if a comes after b

(Char <=? a b)

Test whether a character is less than or equal to another.

Parameters:

Returns: BOOL — True if a is equal to or comes before b

(Char >=? a b)

Test whether a character is greater than or equal to another.

Parameters:

Returns: BOOL — True if a is equal to or comes after b

(Char ci=? a b)

Case-insensitive character equality.

Parameters:

Returns: BOOL — True if characters are equal ignoring case

(Char ci<? a b)

Case-insensitive character less-than.

Parameters:

Returns: BOOL — True if a < b ignoring case

(Char ci>? a b)

Case-insensitive character greater-than.

Parameters:

Returns: BOOL — True if a > b ignoring case

(Char ci<=? a b)

Case-insensitive character less-than-or-equal.

Parameters:

Returns: BOOL — True if a <= b ignoring case

(Char ci>=? a b)

Case-insensitive character greater-than-or-equal.

Parameters:

Returns: BOOL — True if a >= b ignoring case