Next: , Previous: , Up: Dictionary   [Contents][Index]


13.3.2 Characters

Remember that CMUCL’s characters are only 16-bits long but Unicode codepoints are up to 21 bits long. Hence there are codepoints that cannot be represented via Lisp characters. Operating on individual characters is not recommended. Operations on strings are better. (This would be true even if CMUCL’s characters could hold a full Unicode codepoint.)

Function: char-equal &rest characters
Function: char-not-equal &rest characters
Function: char-lessp &rest characters
Function: char-greaterp &rest characters
Function: char-not-greaterp &rest characters
Function: char-not-lessp &rest characters

For the comparison, the characters are converted to lowercase and the corresponding char-code are compared.

Function: alpha-char-p character

Returns non-nil if the Unicode category is a letter category.

Function: alphanumericp character

Returns non-nil if the Unicode category is a letter category or an ASCII digit.

Function: digit-char-p character &optional radix

Only recognizes ASCII digits (and ASCII letters if the radix is larger than 10).

Function: graphic-char-p character

Returns non-nil if the Unicode category is a graphic category.

Function: upper-case-p character
Function: lower-case-p character

Returns non-nil if the Unicode category is an uppercase (lowercase) character.

Function: lisp:title-case-p character

Returns non-nil if the Unicode category is a titlecase character.

Function: both-case-p character

Returns non-nil if the Unicode category is an uppercase, lowercase, or titlecase character.

Function: char-upcase character
Function: char-downcase character

The Unicode uppercase (lowercase) letter is returned.

Function: lisp:char-titlecase character

The Unicode titlecase letter is returned.

Function: char-name char

If possible the name of the character char is returned. If there is a Unicode name, the Unicode name is returned, except spaces are converted to underscores and the string is capitalized via string-capitalize. If there is no Unicode name, the form #\U+xxxx is returned where “xxxx” is the char-code of the character, in hexadecimal.

Function: name-char name

The inverse to char-name. If no character has the name name, then nil is returned. Unicode names are not case-sensitive, and spaces and underscores are optional.


Next: Strings, Previous: Variables, Up: Dictionary   [Contents][Index]