reader is controlled by a
A readtable is an array of fixnums, one fixnum for each of the 128
The fixnums tell the reader what the properties of the each character
The initial readtable is described below.
The user may create new readtables using the
The current readtable is the value of the lisp
which, like any lisp symbol, may be
lambda bound to allow the user to change the
reader syntax very quickly.
The values which may appear in the readtable are:
type value (decimal) meaning default
vsign 1 plus or minus + -
vchar 2 alphabetic character T{
A-Z a-z ^H ! $ % & * , / : ; < = > ? @ ^ _ ` { | } ~
vsca 66 single char atom none
vlbrkt 198 left bracket [
vrbrkt 199 right bracket ]
veof 200 end of file rubout
double quote, all characters between matching double
quotes are escaped (i.e. treated as \fBvchar\fP)
string delimiter, all characters between matching
delimiters are concated into an object of type string
verr 203 illegal character T{
vsep 204 separator ^I-^M esc space
vspl 205 splicing macro character none
vmac 206 macro character none
vesc 143 escape character \*e
The names in the type column are not known to Franz, we are just using them
to tag the various classes. You must use the value in the second column.
The default column shows the syntax values of characters in the raw lisp,
i.e., the lisp which contains only machine language functions. The lisp
which you get when you give the lisp command to the shell is an augmented
version of the raw lisp, with additional lisp coded functions and changes
The syntax changes in the lisp may differ from installation to installation
but will probably include making one character be a comment character.
In the lisp at Berkeley, semicolon is the comment character. This
was done by declaring it to be a splicing macro character which
To read the syntax of a character, you may use
(\fBstatus\ syntax\fP\ 's_char).
To change the syntax bits of a character, use the
There are two forms, one when you just want to change the syntax bits,
and the other when you want to define a character macro.
.tl ''(\fBsetsyntax\fP \fI\'s_c \'x_value\fP)''
may be the character itself or it may be the fixnum representation
is one of the values given above in the second column.
You should be careful when you change the syntax of a character
as the change lasts until you explicitly change it back or until you
Also, some syntax changes are silly and will probably cause system
errors (e.g. changing the syntax of an alphabetic character to be
The only syntax values you will probably ever use are:
You should not change the syntax to
instead it will be done automatically when you use the form below.
To declare a character macro use:
.tl ''(\fBsetsyntax\fP \fI\'s_c \'s_type \'s_fcn\fP)''
is again either the character itself or its fixnum equivalent,
a function expecting no arguments or is a lambda expression.
The result of the setsyntax function is twofold: the readtable value
for that character is changed to
is put on the property list of the character under the indicator "macro".
The difference between a splicing macro and a macro is this: the value
returned by a splicing macro is
to what has been read so far
(i.e. (\fBnconc\fP\ sofar\ justreturned)),
while the value returned by a macro is added to what has been read,
(i.e (\fBnconc\fP\ sofar\ (\fBlist\fP justread)).
Thus if a splicing macro returns nil, then it isn't seen since
(\fBnconc\fP any nil)\ ==>\ any.
In particular splicing macros are useful for conditional loading of
treats left and right square brackets in a special way when
A left bracket is just like a left parenthesis, and a right bracket
matches a left bracket or all open left parentheses, whichever comes
When building atoms, a character with the syntax code
will cause the next character to be read in and treated as a
To escape an entire string of characters, you surround them with matching
character within the string of characters you use any character of class
escape character, backslash (`\*e'), is in this class by default.