The *readtable* is a system variable that contains XLISP's data
structures relating to the processing of characters from the user (or files)
and read-macro expansions. The table is 128 entries [0..127] for each of the
7-bit ASCII characters that
XLISP can read. Each entry in the *readtable* array must be one of
NIL |
|||
:CONSTITUENT |
|||
:WHITE-SPACE |
|||
:SESCAPE |
|||
:MESCAPE |
|||
(:TMACRO . fun) |
|||
(:NMACRO . fun) |
In the case of :nmacro and
(:tmacro . function) (:nmacro . function)
The 'function' can be a built-in read-macro function or a user defined lambda expression. The 'function' takes two parameters, an input stream specification, and an integer that is the character value. The 'function' should return NIL if the character is 'white-space' or a value consed with NIL to return the value.
*readtable* ; returns the current table ;; define a function to look in a table and ;; print out any entries with a function (defun look-at (table) (dotimes (ch 127) (prog ((entry (aref table ch))) (case entry (nil nil) (:constituent nil) (:white-space nil) (:sescape nil) (:mescape nil) (t (princ (int-char ch)))))) (terpri)) (look-at *readtable*) ; prints "#'(),;`
Caution: If you experiment with *readtable*, it is useful to save the old value in a variable, so that you can restore the system state.
See the
*readtable*
system variable in the