Characters

Characters are represented inside the machine as small integers using a character code. ASCII (American Standard Code for Information Interchange) is the most commonly used character code.

The character type in Lisp is used to represent and manipulate characters in a way that does not depend upon the particular code that is used.

Character constants are written using the prefix #\ :


#\a        #\A         #\(
#\space    #\newline

(char? obj) tests whether obj is a character.

(char-alphabetic? char)
(char-numeric? char)
(char-whitespace? char)
(char-upper-case? char)
(char-lower-case? char)
These predicates test whether characters are in the specified classes. The class whitespace includes the characters space, tab, and newline.

Contents    Page-10    Prev    Next    Page+10    Index