The named-read-macros Reference Manual

This is the named-read-macros Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sat Dec 03 22:36:26 2022 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 named-read-macros

Make read macros more Lispy. Attach read macros to symbols.

Maintainer

William Yao <>

Author

William Yao <>

License

BSD-3

Long Description

Provide a definition facility to define read macros and attach them to symbols, avoiding the possibility of collisions in readtable characters.

Version

1.0.0

Dependency

named-readtables (system).

Source

named-read-macros.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 named-read-macros/named-read-macros.asd

Source

named-read-macros.asd.

Parent Component

named-read-macros (system).

ASDF Systems

named-read-macros.


3.1.2 named-read-macros/packages.lisp

Source

named-read-macros.asd.

Parent Component

named-read-macros (system).

Packages

named-read-macros.


3.1.3 named-read-macros/named-read-macros.lisp

Dependency

packages.lisp (file).

Source

named-read-macros.asd.

Parent Component

named-read-macros (system).

Public Interface
Internals

3.1.4 named-read-macros/readtables.lisp

Dependency

named-read-macros.lisp (file).

Source

named-read-macros.asd.

Parent Component

named-read-macros (system).


4 Packages

Packages are listed by definition order.


4.1 named-read-macros

Source

packages.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: define (name &body body)

Creates a named read macro, which executes ‘BODY‘ in a context where ‘*STANDARD-INPUT*‘ is bound to a stream containing just the contents which the read macro was called with, and associates this macro with ‘NAME‘.

Just like a normal macro, ‘BODY‘ should return a Lisp form to then get evaluated where the named read macro was called.

Because ‘NAMED-READ-MACROS‘ hijacks the Lisp reader, we can’t rely on matching parentheses to know when the newly-defined read macro *ends*, so we look for the sequence of characters ‘’END-${NAME}’‘, *immediately* followed by a close parenthesis, in order to know when the read macro ends. Case is checked against ‘NAME‘ by transforming the ending string according to the case of the current readtable; if ‘(SYMBOL-NAME NAME)‘ matches the transformed ending string exactly, we’ve found the end tag. In particular, this means that using ‘DEFINE‘ with a pipe-enclosed symbol with lowercase characters will make such a read macro impossible to end under the standard readtable (though why one would define such a macro is another question entirely!)

Leading whitespace after opening the read macro will not be passed to ‘BODY‘, but trailing whitespace before the ending tag will.

Note that ‘DEFINE‘ has no compile-time effects by default; the rationale is that doing so would also require any functions used by a read macro defined by ‘DEFINE‘ to be available at compile-time. Since this is not the usual, ‘DEFINE‘ explicitly has no compile-time effects to avoid this problem. If you want a named read macro to be available at compile-time, wrap ‘DEFINE‘ and any necessary functions in an explicit ‘EVAL-WHEN‘.

Package

named-read-macros.

Source

named-read-macros.lisp.


5.1.2 Generic functions

Generic Reader: read-macro-redefinition-warning-name (condition)
Package

named-read-macros.

Methods
Reader Method: read-macro-redefinition-warning-name ((condition read-macro-redefinition-warning))
Source

named-read-macros.lisp.

Target Slot

name.

Generic Reader: read-macro-redefinition-warning-prev-type (condition)
Package

named-read-macros.

Methods
Reader Method: read-macro-redefinition-warning-prev-type ((condition read-macro-redefinition-warning))
Source

named-read-macros.lisp.

Target Slot

prev-type.


5.1.3 Conditions

Condition: read-macro-redefinition-warning
Package

named-read-macros.

Source

named-read-macros.lisp.

Direct superclasses

style-warning.

Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

read-macro-redefinition-warning-name.

Writers

This slot is read-only.

Slot: prev-type
Initargs

:prev-type

Readers

read-macro-redefinition-warning-prev-type.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Ordinary functions

Function: check-if-bound (symb)
Package

named-read-macros.

Source

named-read-macros.lisp.

Function: read-maybe-read-macro (stream &optional char)
Package

named-read-macros.

Source

named-read-macros.lisp.

Function: read-string-end (stream symbol)
Package

named-read-macros.

Source

named-read-macros.lisp.

Function: readtable-case-transform-fn (&optional readtable)

Return a function which will transform any string per the given readtable’s case-sensitivity.

Package

named-read-macros.

Source

named-read-macros.lisp.


Appendix A Indexes


A.1 Concepts


A.3 Variables

Jump to:   N   P   S  
Index Entry  Section

N
name: Public conditions

P
prev-type: Public conditions

S
Slot, name: Public conditions
Slot, prev-type: Public conditions