Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

This library allows you to intercept the Lisp reader
and replace the Lisp syntax with your own.

Applications include:
* using COMPILE-FILE to compile files in arbitrary languages,
 by having a reader that expands the language into Lisp code.
* having your own improved syntax replace the CL syntax
 while using the CL runtime.

==== Exported Functionality ====

The reader-interception library creates a package READER-INTERCEPTION,
that exports the following macros and functions:

  This macro allows you to intercept the reader within its BODY.
  READER is a function that has the same interface as #'CL:READ.
  You must pass a HINT, which must be one of:
  * the pathname of the file that will be read
  * the stream that will be read
  * the string that will be read from
  * the first character of the file, stream or string that will be read from.
  * T if you don't know or care which character that will be, but
    can promise it will be ASCII (char-code strictly less than 128).
  * NIL if you promise that whichever character will be next read (if any)
    has already been seen by the reader-interception
    (notably works on empty files/streams/strings).