The reader-interception Reference Manual

This is the reader-interception Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed May 15 06:44:02 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 reader-interception

Intercept the reader to replace CL syntax with your own

Author

Francois-Rene Rideau

License

MIT

Version

1.0.0

Source

reader-interception.asd.

Child Component

reader-interception.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 reader-interception/reader-interception.asd

Source

reader-interception.asd.

Parent Component

reader-interception (system).

ASDF Systems

reader-interception.


3.1.2 reader-interception/reader-interception.lisp

Source

reader-interception.asd.

Parent Component

reader-interception (system).

Packages

reader-interception.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 reader-interception

Source

reader-interception.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: with-reader-interception ((hint reader) &body body)

You may override the Common Lisp reader, e.g. around LOAD or COMPILE-FILE, by using WITH-READER-INTERCEPTION (HINT READER) BODY...
thus replacing the CL syntax with any syntax of your choice.
By combining this with ASDF 2.018’s :around-compile hook,
you could compile any language with CL via a proper translation frontend. You *must* specify a HINT to pass to PREPARE-READER-INTERCEPTION,
to help the interception find the first (next) character that will be read, so it can intercept reading from there.
You must specify your READER, a function taking a STREAM as argument, and either returning an object or raising an error
such as READER-ERROR or END-OF-FILE.
Inside the BODY, the *READTABLE* is set so that you may READ
from a stream starting with the hinted character, and
it will use your specified parser instead of the CL reader.
Inside the READER itself, READ will behave like the unintercepted CL reader.

Package

reader-interception.

Source

reader-interception.lisp.


5.1.2 Ordinary functions

Function: prepare-reader-interception (hint &key external-format)

Before you may intercept the CL reader, you MUST prime
the reader-interception with the first character to be read.
You may give the character itself,
NIL for no character (e.g. EOF),
T for any ASCII characters (assuming the first one won’t be further unicode), a stream to read the character from,
a string that will be used as input stream,
a pathname to be open as a stream to read from with specified external-format

Package

reader-interception.

Source

reader-interception.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *intercepted-characters*
Package

reader-interception.

Source

reader-interception.lisp.

Special Variable: *interception-readtable*
Package

reader-interception.

Source

reader-interception.lisp.

Special Variable: *reader*
Package

reader-interception.

Source

reader-interception.lisp.

Special Variable: *saved-readtable*
Package

reader-interception.

Source

reader-interception.lisp.

Special Variable: *standard-readtable*
Package

reader-interception.

Source

reader-interception.lisp.


5.2.2 Ordinary functions

Function: call-with-reader-interception (thunk &optional hint reader)
Package

reader-interception.

Source

reader-interception.lisp.

Function: initialize-interception ()
Package

reader-interception.

Source

reader-interception.lisp.

Function: intercept-char-reader (stream char)
Package

reader-interception.

Source

reader-interception.lisp.

Function: prepare-all-ascii ()
Package

reader-interception.

Source

reader-interception.lisp.

Function: prepare-character (x)
Package

reader-interception.

Source

reader-interception.lisp.

Function: standard-read (&key stream eof-error-p eof-value recursive-p)
Package

reader-interception.

Source

reader-interception.lisp.


Appendix A Indexes


A.1 Concepts