Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

:tmacro

:tmacro

type: keyword
location: built-in
source file: xlread.c
Common LISP compatible: no
supported on: all machines

SYNTAX

(:tmacro . <function> )
        <function>      -       a function

DESCRIPTION

:TMACRO is an entry that is used in the *READTABLE*. *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 existance of the :TMACRO keyword means that the specified character is a terminal read macro. For :TMACRO, the form of the *READTABLE* entry is a dotted pair like (:TMACRO . <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. The <function> will probably read additional characters from the input stream.

EXAMPLES

(defun look-at (table)                  ; define a function to 
 (dotimes (ch 127)                      ;   look in a table
  (prog ( (entry (aref table ch)) )     ;   and print out any     
        (if (and (consp entry)          ;   :TMACRO entries
                 (equal (car entry)     ;
                        ':TMACRO))      ;
          (princ (int-char ch)))))      ;
 (terpri))                              ;
                                        ;
(look-at *readtable*)                   ;  prints "'(),;`

NOTE: The system defines that the following are :TMACRO characters:

\ " ` , ( ) ;

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.


Go to the first, previous, next, last section, table of contents.