The named-readtables Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The named-readtables Reference Manual

This is the named-readtables Reference Manual, version 0.9, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed Jun 15 05:23:59 2022 GMT+0.

Table of Contents


1 Introduction

# Named Readtables Manual

###### \[in package EDITOR-HINTS.NAMED-READTABLES with nicknames NAMED-READTABLES\]
## NAMED-READTABLES ASDF System

- Version: 0.9
- Description: Library that creates a namespace for readtables akin
  to the namespace of packages.
- Licence: BSD, see LICENSE
- Author: Tobias C. Rittweiler 
- Maintainer: Gábor Melis 
- Mailto: [mega@retes.hu](mailto:mega@retes.hu)
- Homepage: [http://melisgl.github.io/named-readtables](http://melisgl.github.io/named-readtables)
- Bug tracker: [https://github.com/melisgl/named-readtables/issues](https://github.com/melisgl/named-readtables/issues)
- Source control: [GIT](https://github.com/melisgl/named-readtables.git)

## Introduction

Named-Readtables is a library that provides a namespace for
readtables akin to the already-existing namespace of packages. In
particular:

- you can associate readtables with names, and retrieve
  readtables by names;

- you can associate source files with readtable names, and be
  sure that the right readtable is active when compiling/loading
  the file;

- similiarly, your development environment now has a chance to
  automatically determine what readtable should be active while
  processing source forms on interactive commands. (E.g. think of
  `C-c C-c` in Slime (yet to be done))

It follows that Named-Readtables is a facility for using readtables in
a localized way.

Additionally, it also attempts to become a facility for using
readtables in a *modular* way. In particular:

- it provides a macro to specify the content of a readtable at a
 glance;

- it makes it possible to use multiple inheritance between readtables.


### Links

Here is the [official repository][named-readtables-repo] and the
[HTML documentation][named-readtables-doc] for the latest version.

[named-readtables-repo]: https://github.com/melisgl/named-readtables 

[named-readtables-doc]: http://melisgl.github.io/mgl-pax-world/named-readtables-manual.html 


### Acknowledgements

Thanks to Robert Goldman for making me want to write this library.

Thanks to Stephen Compall, Ariel Badichi, David Lichteblau, Bart
Botta, David Crawford, and Pascal Costanza for being early adopters,
providing comments and bugfixes.

## Overview

### Notes on the API

The API heavily imitates the API of packages. This has the nice
property that any experienced Common Lisper will take it up without
effort.

    DEFREADTABLE              -   DEFPACKAGE
    
    IN-READTABLE              -   IN-PACKAGE
    
    MERGE-READTABLES-INTO     -   USE-PACKAGE
    
    MAKE-READTABLE            -   MAKE-PACKAGE
    
    UNREGISTER-READTABLE      -   DELETE-PACKAGE
    
    RENAME-READTABLE          -   RENAME-PACKAGE
    
    FIND-READTABLE            -   FIND-PACKAGE
    
    READTABLE-NAME            -   PACKAGE-NAME
    
    LIST-ALL-NAMED-READTABLES -   LIST-ALL-PACKAGES


### Important API idiosyncrasies

There are three major differences between the API of Named-Readtables,
and the API of packages.

1. Readtable names are symbols not strings.

    Time has shown that the fact that packages are named by strings
    causes severe headache because of the potential of package names
    colliding with each other.

    Hence, readtables are named by symbols lest to make the
    situation worse than it already is. Consequently, readtables
    named `CL-ORACLE:SQL-SYNTAX` and `CL-MYSQL:SQL-SYNTAX` can
    happily coexist next to each other. Or, taken to an extreme,
    `SCHEME:SYNTAX` and `ELISP:SYNTAX`.

    If, for example to duly signify the importance of your cool
    readtable hack, you really think it deserves a global name, you
    can always resort to keywords.

2. The inheritance is resolved statically, not dynamically.

    A package that uses another package will have access to all the
    other package's exported symbols, even to those that will be
    added after its definition. I.e. the inheritance is resolved at
    run-time, that is dynamically.

    Unfortunately, we cannot do the same for readtables in a
    portable manner.

    Therefore, we do not talk about "using" another readtable but
    about "merging" the other readtable's definition into the
    readtable we are going to define. I.e. the inheritance is
    resolved once at definition time, that is statically.

    (Such merging can more or less be implemented portably albeit at
    a certain cost. Most of the time, this cost manifests itself at
    the time a readtable is defined, i.e. once at compile-time, so
    it may not bother you. Nonetheless, we provide extra support for
    Sbcl, ClozureCL, and AllegroCL at the moment. Patches for your
    implementation of choice are welcome, of course.)

3. DEFREADTABLE does not have compile-time effects.

    If you define a package via DEFPACKAGE, you can make that
    package the currently active package for the subsequent
    compilation of the same file via IN-PACKAGE. The same is,
    however, not true for DEFREADTABLE and IN-READTABLE for the
    following reason:

    It's unlikely that the need for special reader-macros arises for
    a problem which can be solved in just one file. Most often,
    you're going to define the reader macro functions, and set up
    the corresponding readtable in an extra file.

    If DEFREADTABLE had compile-time effects, you'd have to wrap
    each definition of a reader-macro function in an EVAL-WHEN to
    make its definition available at compile-time. Because that's
    simply not the common case, DEFREADTABLE does not have a
    compile-time effect.

    If you want to use a readtable within the same file as its
    definition, wrap the DEFREADTABLE and the reader-macro function
    definitions in an explicit EVAL-WHEN.


### Preregistered Readtables

- NIL, :STANDARD, and :COMMON-LISP designate the
*standard readtable*.

- :MODERN designates a *case-preserving* *standard-readtable*.

- :CURRENT designates the *current readtable*.


### Examples

```commonlisp
(defreadtable elisp:syntax
   (:merge :standard)
   (:macro-char #\? #'elisp::read-character-literal t)
   (:macro-char #\[ #'elisp::read-vector-literal t)
   ...
   (:case :preserve))

(defreadtable scheme:syntax
   (:merge :standard)
   (:macro-char #\[ #'(lambda (stream char)
                         (read-delimited-list #\] stream)))
   (:macro-char #\# :dispatch)
   (:dispatch-macro-char #\# #\t #'scheme::read-#t)
   (:dispatch-macro-char #\# #\f #'scheme::read-#f)
   ...
   (:case :preserve))

(in-readtable elisp:syntax)

...

(in-readtable scheme:syntax)

...
```


## Reference

- [macro] DEFREADTABLE NAME &BODY OPTIONS

    Define a new named readtable, whose name is given by the symbol NAME.
    Or, if a readtable is already registered under that name, redefine
    that one.
    
    The readtable can be populated using the following OPTIONS:
    
    - If the first element of OPTIONS is a string then it is associated
      with the readtable as in `(SETF (DOCUMENTATION NAME 'READTABLE)
      DOCSTRING)`.
    
    - `(:MERGE READTABLE-DESIGNATORS+)`
    
        Merge the macro character definitions from the readtables
        designated into the new readtable being defined as per
        MERGE-READTABLES-INTO. The copied options are
        :DISPATCH-MACRO-CHAR, :MACRO-CHAR and :SYNTAX-FROM, but not
        READTABLE-CASE.
    
        If no :MERGE clause is given, an empty readtable is used. See
        MAKE-READTABLE.
    
    - `(:FUSE READTABLE-DESIGNATORS+)`
    
        Like :MERGE except:
    
        Error conditions of type READER-MACRO-CONFLICT that are signaled
        during the merge operation will be silently *continued*. It
        follows that reader macros in earlier entries will be
        overwritten by later ones. For backward compatibility, :FUZE is
        accepted as an alias of :FUSE.
    
    - `(:DISPATCH-MACRO-CHAR MACRO-CHAR SUB-CHAR FUNCTION)`
    
        Define a new sub character `SUB-CHAR` for the dispatching macro
        character `MACRO-CHAR`, per SET-DISPATCH-MACRO-CHARACTER. You
        probably have to define `MACRO-CHAR` as a dispatching macro
        character by the following option first.
    
    - `(:MACRO-CHAR MACRO-CHAR FUNCTION [NON-TERMINATING-P])`
    
        Define a new macro character in the readtable, per
        SET-MACRO-CHARACTER. If [FUNCTION][argument] is the keyword
        :DISPATCH, `MACRO-CHAR` is made a dispatching macro character,
        per MAKE-DISPATCH-MACRO-CHARACTER.
    
    - `(:SYNTAX-FROM FROM-READTABLE-DESIGNATOR FROM-CHAR TO-CHAR)`
    
        Set the character syntax of TO-CHAR in the readtable being
        defined to the same syntax as FROM-CHAR as per
        SET-SYNTAX-FROM-CHAR.
    
    - `(:CASE CASE-MODE)`
    
        Defines the *case sensitivity mode* of the resulting readtable.
    
    Any number of option clauses may appear. The options are grouped by
    their type, but in each group the order the options appeared
    textually is preserved. The following groups exist and are executed
    in the following order: :MERGE and :FUSE (one group), :CASE,
    :MACRO-CHAR and :DISPATCH-MACRO-CHAR (one group), finally
    :SYNTAX-FROM.
    
    Notes:
    
    The readtable is defined at load-time. If you want to have it
    available at compilation time -- say to use its reader-macros in the
    same file as its definition -- you have to wrap the DEFREADTABLE
    form in an explicit EVAL-WHEN.
    
    On redefinition, the target readtable is made empty first before
    it's refilled according to the clauses.
    
    NIL, :STANDARD, :COMMON-LISP, :MODERN, and :CURRENT are
    preregistered readtable names.

- [macro] IN-READTABLE NAME

    Set *READTABLE* to the readtable referred to by the symbol NAME.
    Return the readtable.

- [function] MAKE-READTABLE &OPTIONAL (NAME NIL NAME-SUPPLIED-P) &KEY MERGE

    Creates and returns a new readtable under the specified
    NAME.
    
    MERGE takes a list of NAMED-READTABLE-DESIGNATORs and specifies the
    readtables the new readtable is created from. (See the :MERGE clause
    of DEFREADTABLE for details.)
    
    If MERGE is NIL, an empty readtable is used instead.
    
    If NAME is not given, an anonymous empty readtable is returned.
    
    Notes:
    
    An empty readtable is a readtable where each character's syntax is
    the same as in the *standard readtable* except that each macro
    character has been made a constituent. Basically: whitespace stays
    whitespace, everything else is constituent.

- [function] MERGE-READTABLES-INTO RESULT-READTABLE &REST NAMED-READTABLES

    Copy macro character definitions of each readtable in
    NAMED-READTABLES into RESULT-READTABLE.
    
    If a macro character appears in more than one of the readtables,
    i.e. if a conflict is discovered during the merge, an error of type
    READER-MACRO-CONFLICT is signaled.
    
    The copied options are :DISPATCH-MACRO-CHAR, :MACRO-CHAR and
    :SYNTAX-FROM, but not READTABLE-CASE.

- [function] FIND-READTABLE NAME

    Looks for the readtable specified by NAME and returns it if it is
    found. Returns NIL otherwise.

- [function] ENSURE-READTABLE NAME &OPTIONAL (DEFAULT NIL DEFAULT-P)

    Looks up the readtable specified by NAME and returns it if it's found.
    If it is not found, it registers the readtable designated by DEFAULT
    under the name represented by NAME; or if no default argument is
    given, it signals an error of type READTABLE-DOES-NOT-EXIST
    instead.

- [function] RENAME-READTABLE OLD-NAME NEW-NAME

    Replaces the associated name of the readtable designated by
    OLD-NAME with NEW-NAME. If a readtable is already registered under
    NEW-NAME, an error of type READTABLE-DOES-ALREADY-EXIST is
    signaled.

- [function] READTABLE-NAME NAMED-READTABLE

    Returns the name of the readtable designated by NAMED-READTABLE,
    or NIL.

- [function] REGISTER-READTABLE NAME READTABLE

    Associate READTABLE with NAME. Returns the readtable.

- [function] UNREGISTER-READTABLE NAMED-READTABLE

    Remove the association of NAMED-READTABLE. Returns T if successfull,
    NIL otherwise.

- [function] COPY-NAMED-READTABLE NAMED-READTABLE

    Like COPY-READTABLE but takes a NAMED-READTABLE-DESIGNATOR as argument.

- [function] LIST-ALL-NAMED-READTABLES

    Returns a list of all registered readtables. The returned list is
    guaranteed to be fresh, but may contain duplicates.

- [type] NAMED-READTABLE-DESIGNATOR

    Either a symbol or a readtable itself.

- [condition] READTABLE-ERROR ERROR

- [condition] READER-MACRO-CONFLICT READTABLE-ERROR

    Continuable.
    
    This condition is signaled during the merge process if a reader
    macro (be it a macro character or the sub character of a dispatch
    macro character) is present in the both source and the target
    readtable and the two respective reader macro functions differ.

- [condition] READTABLE-DOES-ALREADY-EXIST READTABLE-ERROR

    Continuable.

- [condition] READTABLE-DOES-NOT-EXIST READTABLE-ERROR

* * *
###### \[generated by [MGL-PAX](https://github.com/melisgl/mgl-pax)\]


2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 named-readtables

Library that creates a namespace for readtables akin to the namespace of packages.

Maintainer

Gábor Melis <mega@retes.hu>

Author

Tobias C. Rittweiler <trittweiler@common-lisp.net>

Contact

mega@retes.hu

Home Page

http://melisgl.github.io/named-readtables

Source Control

(GIT https://github.com/melisgl/named-readtables.git)

Bug Tracker

https://github.com/melisgl/named-readtables/issues

License

BSD, see LICENSE

Version

0.9

Source

named-readtables.asd.

Child Components

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 named-readtables/named-readtables.asd

Source

named-readtables.asd.

Parent Component

named-readtables (system).

ASDF Systems

named-readtables.


3.1.2 named-readtables/package.lisp

Source

named-readtables.asd.

Parent Component

named-readtables (system).

Packages

editor-hints.named-readtables.


3.1.3 named-readtables/utils.lisp

Dependency

package.lisp (file).

Source

named-readtables.asd.

Parent Component

named-readtables (system).

Internals

3.1.4 named-readtables/define-api.lisp

Dependency

utils.lisp (file).

Source

named-readtables.asd.

Parent Component

named-readtables (system).

Internals

define-api (macro).


3.1.5 named-readtables/cruft.lisp

Dependency

define-api.lisp (file).

Source

named-readtables.asd.

Parent Component

named-readtables (system).

Internals

3.1.6 named-readtables/named-readtables.lisp

Dependency

cruft.lisp (file).

Source

named-readtables.asd.

Parent Component

named-readtables (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 editor-hints.named-readtables

See NAMED-READTABLES:@NAMED-READTABLES-MANUAL.

Source

package.lisp.

Nickname

named-readtables

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Macros

Macro: defreadtable (name &body options)

Define a new named readtable, whose name is given by the symbol NAME. Or, if a readtable is already registered under that name, redefine that one.

The readtable can be populated using the following OPTIONS:

- If the first element of OPTIONS is a string then it is associated with the readtable as in ‘(SETF (DOCUMENTATION NAME ’READTABLE) DOCSTRING)‘.

- ‘(:MERGE READTABLE-DESIGNATORS+)‘

Merge the macro character definitions from the readtables designated into the new readtable being defined as per MERGE-READTABLES-INTO. The copied options are :DISPATCH-MACRO-CHAR, :MACRO-CHAR and :SYNTAX-FROM, but not READTABLE-CASE.

If no :MERGE clause is given, an empty readtable is used. See MAKE-READTABLE.

- ‘(:FUSE READTABLE-DESIGNATORS+)‘

Like :MERGE except:

Error conditions of type READER-MACRO-CONFLICT that are signaled during the merge operation will be silently _continued_. It follows that reader macros in earlier entries will be overwritten by later ones. For backward compatibility, :FUZE is accepted as an alias of :FUSE.

- ‘(:DISPATCH-MACRO-CHAR MACRO-CHAR SUB-CHAR FUNCTION)‘

Define a new sub character ‘SUB-CHAR‘ for the dispatching macro character ‘MACRO-CHAR‘, per SET-DISPATCH-MACRO-CHARACTER. You probably have to define ‘MACRO-CHAR‘ as a dispatching macro character by the following option first.

- ‘(:MACRO-CHAR MACRO-CHAR FUNCTION [NON-TERMINATING-P])‘

Define a new macro character in the readtable, per SET-MACRO-CHARACTER. If [FUNCTION][argument] is the keyword :DISPATCH, ‘MACRO-CHAR‘ is made a dispatching macro character, per MAKE-DISPATCH-MACRO-CHARACTER.

- ‘(:SYNTAX-FROM FROM-READTABLE-DESIGNATOR FROM-CHAR TO-CHAR)‘

Set the character syntax of TO-CHAR in the readtable being defined to the same syntax as FROM-CHAR as per SET-SYNTAX-FROM-CHAR.

- ‘(:CASE CASE-MODE)‘

Defines the _case sensitivity mode_ of the resulting readtable.

Any number of option clauses may appear. The options are grouped by their type, but in each group the order the options appeared textually is preserved. The following groups exist and are executed in the following order: :MERGE and :FUSE (one group), :CASE, :MACRO-CHAR and :DISPATCH-MACRO-CHAR (one group), finally :SYNTAX-FROM.

Notes:

The readtable is defined at load-time. If you want to have it available at compilation time – say to use its reader-macros in the same file as its definition – you have to wrap the DEFREADTABLE form in an explicit EVAL-WHEN.

On redefinition, the target readtable is made empty first before it’s refilled according to the clauses.

NIL, :STANDARD, :COMMON-LISP, :MODERN, and :CURRENT are preregistered readtable names.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Macro: in-readtable (name)

Set *READTABLE* to the readtable referred to by the symbol NAME. Return the readtable.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.2 Compiler macros

Compiler Macro: ensure-readtable (name &optional default)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Compiler Macro: register-readtable (name readtable)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.


5.1.3 Setf expanders

Setf Expander: (setf find-readtable) (name)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Reader

find-readtable (function).

Writer

register-readtable (function).


5.1.4 Ordinary functions

Function: copy-named-readtable (named-readtable)

Like COPY-READTABLE but takes a NAMED-READTABLE-DESIGNATOR as argument.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: ensure-readtable (name &optional default)

Looks up the readtable specified by NAME and returns it if it’s found. If it is not found, it registers the readtable designated by DEFAULT under the name represented by NAME; or if no default argument is given, it signals an error of type READTABLE-DOES-NOT-EXIST instead.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: find-readtable (name)

Looks for the readtable specified by NAME and returns it if it is found. Returns NIL otherwise.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Setf expander for this function

(setf find-readtable).

Function: list-all-named-readtables ()

Returns a list of all registered readtables. The returned list is guaranteed to be fresh, but may contain duplicates.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: make-readtable (&optional name &key merge)

Creates and returns a new readtable under the specified
NAME.

MERGE takes a list of NAMED-READTABLE-DESIGNATORs and specifies the readtables the new readtable is created from. (See the :MERGE clause of DEFREADTABLE for details.)

If MERGE is NIL, an empty readtable is used instead.

If NAME is not given, an anonymous empty readtable is returned.

Notes:

An empty readtable is a readtable where each character’s syntax is the same as in the _standard readtable_ except that each macro character has been made a constituent. Basically: whitespace stays whitespace, everything else is constituent.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: merge-readtables-into (result-readtable &rest named-readtables)

Copy macro character definitions of each readtable in NAMED-READTABLES into RESULT-READTABLE.

If a macro character appears in more than one of the readtables, i.e. if a conflict is discovered during the merge, an error of type READER-MACRO-CONFLICT is signaled.

The copied options are :DISPATCH-MACRO-CHAR, :MACRO-CHAR and :SYNTAX-FROM, but not READTABLE-CASE.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: readtable-name (named-readtable)

Returns the name of the readtable designated by NAMED-READTABLE, or NIL.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: register-readtable (name readtable)

Associate READTABLE with NAME. Returns the readtable.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Setf expanders to this function

(setf find-readtable).

Function: rename-readtable (old-name new-name)

Replaces the associated name of the readtable designated by OLD-NAME with NEW-NAME. If a readtable is already registered under NEW-NAME, an error of type READTABLE-DOES-ALREADY-EXIST is signaled.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: unregister-readtable (named-readtable)

Remove the association of NAMED-READTABLE. Returns T if successfull, NIL otherwise.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.


5.1.5 Conditions

Condition: reader-macro-conflict

Continuable.

This condition is signaled during the merge process if a reader macro (be it a macro character or the sub character of a dispatch macro character) is present in the both source and the target readtable and the two respective reader macro functions differ.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Direct superclasses

readtable-error.

Direct methods
Direct slots
Slot: macro-char
Initform

(quote (editor-hints.named-readtables::required-argument))

Initargs

:macro-char

Readers

conflicting-macro-char.

Writers

(setf conflicting-macro-char).

Slot: sub-char
Initform

(quote nil)

Initargs

:sub-char

Readers

conflicting-dispatch-sub-char.

Writers

(setf conflicting-dispatch-sub-char).

Slot: from-readtable
Initform

(quote (editor-hints.named-readtables::required-argument))

Initargs

:from-readtable

Readers

from-readtable.

Writers

(setf from-readtable).

Slot: to-readtable
Initform

(quote (editor-hints.named-readtables::required-argument))

Initargs

:to-readtable

Readers

to-readtable.

Writers

(setf to-readtable).

Condition: readtable-does-already-exist

Continuable.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Direct superclasses

readtable-error.

Direct methods
Direct slots
Slot: readtable-name
Initform

(quote (editor-hints.named-readtables::required-argument))

Initargs

:readtable-name

Readers

existing-readtable-name.

Writers

(setf existing-readtable-name).

Condition: readtable-does-not-exist
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Direct superclasses

readtable-error.

Direct methods
Direct slots
Slot: readtable-name
Initform

(quote (editor-hints.named-readtables::required-argument))

Initargs

:readtable-name

Readers

missing-readtable-name.

Writers

(setf missing-readtable-name).

Condition: readtable-error
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Direct superclasses

error.

Direct subclasses

Previous: , Up: Public Interface   [Contents][Index]

5.1.6 Types

Type: named-readtable-designator ()

Either a symbol or a readtable itself.

Package

editor-hints.named-readtables.

Source

named-readtables.lisp.


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Special variables

Special Variable: *case-preserving-standard-readtable*
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Special Variable: *empty-readtable*
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Special Variable: *named-readtables*
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Special Variable: *readtable-names*
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Special Variable: *readtable-to-docstring*
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Special Variable: *reserved-readtable-names*
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Special Variable: *standard-readtable*
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.


5.2.2 Macros

Macro: define-api (name lambda-list type-list &body body)
Package

editor-hints.named-readtables.

Source

define-api.lisp.

Macro: define-cruft (name lambda-list &body docstring)
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Macro: destructure-case (value &body patterns)

Dispatch VALUE to one of PATTERNS.
A cross between ‘case’ and ‘destructuring-bind’.
The pattern syntax is:
((HEAD . ARGS) . BODY)
The list of patterns is searched for a HEAD ‘eq’ to the car of VALUE. If one is found, the BODY is executed with ARGS bound to the corresponding values in the CDR of VALUE.

Package

editor-hints.named-readtables.

Source

utils.lisp.

Macro: do-readtable ((entry-designator readtable &optional result) &body body)

Iterate through a readtable’s macro characters, and dispatch macro characters.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Macro: with-readtable-iterator ((name readtable) &body body)
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Macro: without-package-lock ((&rest package-names) &body body)
Package

editor-hints.named-readtables.

Source

utils.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.3 Ordinary functions

Function: %associate-docstring-with-readtable (readtable docstring)
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %associate-name-with-readtable (name readtable)

Associate NAME with READTABLE for FIND-READTABLE to work.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %associate-readtable-with-name (name readtable)

Associate READTABLE with NAME for READTABLE-NAME to work.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %clear-readtable (readtable)

Make all macro characters in READTABLE be constituents.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %find-readtable (name)

Return the readtable named NAME.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %frob-swank-readtable-alist (package readtable)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: %get-dispatch-macro-character (char subchar rt)

Ensure ANSI behaviour for GET-DISPATCH-MACRO-CHARACTER.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %get-macro-character (char rt)

Ensure ANSI behaviour for GET-MACRO-CHARACTER.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %list-all-readtable-names ()

Return a list of all available readtable names.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %make-readtable-iterator (readtable)
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %readtable-name (readtable)

Return the name associated with READTABLE.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %standard-readtable ()

Return the standard readtable.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %unassociate-docstring-from-readtable (readtable)
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %unassociate-name-from-readtable (name readtable)

Remove the association between NAME and READTABLE

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: %unassociate-readtable-from-name (name readtable)

Remove the association between READTABLE and NAME.

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: check-reader-macro-conflict (from to char &optional subchar)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: constant-standard-readtable-expression-p (thing)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: dispatch-macro-char-p (char rt)

Is CHAR a dispatch macro character in RT?

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: ensure-dispatch-macro-character (char &optional non-terminating-p readtable)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: ensure-function (function-designator)

Returns the function designated by FUNCTION-DESIGNATOR:
if FUNCTION-DESIGNATOR is a function, it is returned, otherwise it must be a function name and its FDEFINITION is returned.

Package

editor-hints.named-readtables.

Source

utils.lisp.

Function: ensure-list (list)

If LIST is a list, it is returned. Otherwise returns the list designated by LIST.

Package

editor-hints.named-readtables.

Source

utils.lisp.

Function: find-reserved-readtable (reserved-name)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: funcall-or (package-and-name-list &rest args)
Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: function= (fn1 fn2)

Are reader-macro function-designators FN1 and FN2 the same?

Package

editor-hints.named-readtables.

Source

cruft.lisp.

Function: parse-body (body &key documentation whole)

Parses BODY into (values remaining-forms declarations doc-string). Documentation strings are recognized only if DOCUMENTATION is true. Syntax errors in body are signalled and WHOLE is used in the signal arguments when given.

Package

editor-hints.named-readtables.

Source

utils.lisp.

Function: parse-ordinary-lambda-list (lambda-list)

Parses an ordinary lambda-list, returning as multiple values:

1. Required parameters.
2. Optional parameter specifications, normalized into form (NAME INIT SUPPLIEDP)
where SUPPLIEDP is NIL if not present.
3. Name of the rest parameter, or NIL.
4. Keyword parameter specifications, normalized into form ((KEYWORD-NAME NAME) INIT SUPPLIEDP) where SUPPLIEDP is NIL if not present.
5. Boolean indicating &ALLOW-OTHER-KEYS presence.
6. &AUX parameter specifications, normalized into form (NAME INIT).

Signals a PROGRAM-ERROR is the lambda-list is malformed.

Package

editor-hints.named-readtables.

Source

utils.lisp.

Function: required-argument (&optional name)

Signals an error for a missing argument of NAME. Intended for use as an initialization form for structure and class-slots, and a default value for required keyword arguments.

Package

editor-hints.named-readtables.

Source

utils.lisp.

Function: reserved-readtable-name-p (name)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: signal-suspicious-registration-warning (name-expr readtable-expr)
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.

Function: simple-program-error (message &rest args)
Package

editor-hints.named-readtables.

Source

utils.lisp.

Function: simple-style-warn (format-control &rest format-args)
Package

editor-hints.named-readtables.

Source

utils.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.4 Generic functions

Generic Reader: conflicting-dispatch-sub-char (condition)
Generic Writer: (setf conflicting-dispatch-sub-char) (condition)
Package

editor-hints.named-readtables.

Methods
Reader Method: conflicting-dispatch-sub-char ((condition reader-macro-conflict))
Writer Method: (setf conflicting-dispatch-sub-char) ((condition reader-macro-conflict))
Source

named-readtables.lisp.

Target Slot

sub-char.

Generic Reader: conflicting-macro-char (condition)
Generic Writer: (setf conflicting-macro-char) (condition)
Package

editor-hints.named-readtables.

Methods
Reader Method: conflicting-macro-char ((condition reader-macro-conflict))
Writer Method: (setf conflicting-macro-char) ((condition reader-macro-conflict))
Source

named-readtables.lisp.

Target Slot

macro-char.

Generic Reader: existing-readtable-name (condition)
Generic Writer: (setf existing-readtable-name) (condition)
Package

editor-hints.named-readtables.

Methods
Reader Method: existing-readtable-name ((condition readtable-does-already-exist))
Writer Method: (setf existing-readtable-name) ((condition readtable-does-already-exist))
Source

named-readtables.lisp.

Target Slot

readtable-name.

Generic Reader: from-readtable (condition)
Generic Writer: (setf from-readtable) (condition)
Package

editor-hints.named-readtables.

Methods
Reader Method: from-readtable ((condition reader-macro-conflict))
Writer Method: (setf from-readtable) ((condition reader-macro-conflict))
Source

named-readtables.lisp.

Target Slot

from-readtable.

Generic Reader: missing-readtable-name (condition)
Generic Writer: (setf missing-readtable-name) (condition)
Package

editor-hints.named-readtables.

Methods
Reader Method: missing-readtable-name ((condition readtable-does-not-exist))
Writer Method: (setf missing-readtable-name) ((condition readtable-does-not-exist))
Source

named-readtables.lisp.

Target Slot

readtable-name.

Generic Reader: to-readtable (condition)
Generic Writer: (setf to-readtable) (condition)
Package

editor-hints.named-readtables.

Methods
Reader Method: to-readtable ((condition reader-macro-conflict))
Writer Method: (setf to-readtable) ((condition reader-macro-conflict))
Source

named-readtables.lisp.

Target Slot

to-readtable.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.5 Conditions

Condition: simple-program-error
Package

editor-hints.named-readtables.

Source

utils.lisp.

Direct superclasses
  • program-error.
  • simple-error.
Condition: simple-style-warning
Package

editor-hints.named-readtables.

Source

utils.lisp.

Direct superclasses
  • simple-warning.
  • style-warning.

Previous: , Up: Internals   [Contents][Index]

5.2.6 Types

Type: readtable-designator ()
Package

editor-hints.named-readtables.

Source

named-readtables.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %   (  
C   D   E   F   G   I   L   M   P   R   S   T   U   W  
Index Entry  Section

%
%associate-docstring-with-readtable: Private ordinary functions
%associate-name-with-readtable: Private ordinary functions
%associate-readtable-with-name: Private ordinary functions
%clear-readtable: Private ordinary functions
%find-readtable: Private ordinary functions
%frob-swank-readtable-alist: Private ordinary functions
%get-dispatch-macro-character: Private ordinary functions
%get-macro-character: Private ordinary functions
%list-all-readtable-names: Private ordinary functions
%make-readtable-iterator: Private ordinary functions
%readtable-name: Private ordinary functions
%standard-readtable: Private ordinary functions
%unassociate-docstring-from-readtable: Private ordinary functions
%unassociate-name-from-readtable: Private ordinary functions
%unassociate-readtable-from-name: Private ordinary functions

(
(setf conflicting-dispatch-sub-char): Private generic functions
(setf conflicting-dispatch-sub-char): Private generic functions
(setf conflicting-macro-char): Private generic functions
(setf conflicting-macro-char): Private generic functions
(setf existing-readtable-name): Private generic functions
(setf existing-readtable-name): Private generic functions
(setf find-readtable): Public setf expanders
(setf from-readtable): Private generic functions
(setf from-readtable): Private generic functions
(setf missing-readtable-name): Private generic functions
(setf missing-readtable-name): Private generic functions
(setf to-readtable): Private generic functions
(setf to-readtable): Private generic functions

C
check-reader-macro-conflict: Private ordinary functions
Compiler Macro, ensure-readtable: Public compiler macros
Compiler Macro, register-readtable: Public compiler macros
conflicting-dispatch-sub-char: Private generic functions
conflicting-dispatch-sub-char: Private generic functions
conflicting-macro-char: Private generic functions
conflicting-macro-char: Private generic functions
constant-standard-readtable-expression-p: Private ordinary functions
copy-named-readtable: Public ordinary functions

D
define-api: Private macros
define-cruft: Private macros
defreadtable: Public macros
destructure-case: Private macros
dispatch-macro-char-p: Private ordinary functions
do-readtable: Private macros

E
ensure-dispatch-macro-character: Private ordinary functions
ensure-function: Private ordinary functions
ensure-list: Private ordinary functions
ensure-readtable: Public compiler macros
ensure-readtable: Public ordinary functions
existing-readtable-name: Private generic functions
existing-readtable-name: Private generic functions

F
find-readtable: Public ordinary functions
find-reserved-readtable: Private ordinary functions
from-readtable: Private generic functions
from-readtable: Private generic functions
funcall-or: Private ordinary functions
Function, %associate-docstring-with-readtable: Private ordinary functions
Function, %associate-name-with-readtable: Private ordinary functions
Function, %associate-readtable-with-name: Private ordinary functions
Function, %clear-readtable: Private ordinary functions
Function, %find-readtable: Private ordinary functions
Function, %frob-swank-readtable-alist: Private ordinary functions
Function, %get-dispatch-macro-character: Private ordinary functions
Function, %get-macro-character: Private ordinary functions
Function, %list-all-readtable-names: Private ordinary functions
Function, %make-readtable-iterator: Private ordinary functions
Function, %readtable-name: Private ordinary functions
Function, %standard-readtable: Private ordinary functions
Function, %unassociate-docstring-from-readtable: Private ordinary functions
Function, %unassociate-name-from-readtable: Private ordinary functions
Function, %unassociate-readtable-from-name: Private ordinary functions
Function, check-reader-macro-conflict: Private ordinary functions
Function, constant-standard-readtable-expression-p: Private ordinary functions
Function, copy-named-readtable: Public ordinary functions
Function, dispatch-macro-char-p: Private ordinary functions
Function, ensure-dispatch-macro-character: Private ordinary functions
Function, ensure-function: Private ordinary functions
Function, ensure-list: Private ordinary functions
Function, ensure-readtable: Public ordinary functions
Function, find-readtable: Public ordinary functions
Function, find-reserved-readtable: Private ordinary functions
Function, funcall-or: Private ordinary functions
Function, function=: Private ordinary functions
Function, list-all-named-readtables: Public ordinary functions
Function, make-readtable: Public ordinary functions
Function, merge-readtables-into: Public ordinary functions
Function, parse-body: Private ordinary functions
Function, parse-ordinary-lambda-list: Private ordinary functions
Function, readtable-name: Public ordinary functions
Function, register-readtable: Public ordinary functions
Function, rename-readtable: Public ordinary functions
Function, required-argument: Private ordinary functions
Function, reserved-readtable-name-p: Private ordinary functions
Function, signal-suspicious-registration-warning: Private ordinary functions
Function, simple-program-error: Private ordinary functions
Function, simple-style-warn: Private ordinary functions
Function, unregister-readtable: Public ordinary functions
function=: Private ordinary functions

G
Generic Function, (setf conflicting-dispatch-sub-char): Private generic functions
Generic Function, (setf conflicting-macro-char): Private generic functions
Generic Function, (setf existing-readtable-name): Private generic functions
Generic Function, (setf from-readtable): Private generic functions
Generic Function, (setf missing-readtable-name): Private generic functions
Generic Function, (setf to-readtable): Private generic functions
Generic Function, conflicting-dispatch-sub-char: Private generic functions
Generic Function, conflicting-macro-char: Private generic functions
Generic Function, existing-readtable-name: Private generic functions
Generic Function, from-readtable: Private generic functions
Generic Function, missing-readtable-name: Private generic functions
Generic Function, to-readtable: Private generic functions

I
in-readtable: Public macros

L
list-all-named-readtables: Public ordinary functions

M
Macro, define-api: Private macros
Macro, define-cruft: Private macros
Macro, defreadtable: Public macros
Macro, destructure-case: Private macros
Macro, do-readtable: Private macros
Macro, in-readtable: Public macros
Macro, with-readtable-iterator: Private macros
Macro, without-package-lock: Private macros
make-readtable: Public ordinary functions
merge-readtables-into: Public ordinary functions
Method, (setf conflicting-dispatch-sub-char): Private generic functions
Method, (setf conflicting-macro-char): Private generic functions
Method, (setf existing-readtable-name): Private generic functions
Method, (setf from-readtable): Private generic functions
Method, (setf missing-readtable-name): Private generic functions
Method, (setf to-readtable): Private generic functions
Method, conflicting-dispatch-sub-char: Private generic functions
Method, conflicting-macro-char: Private generic functions
Method, existing-readtable-name: Private generic functions
Method, from-readtable: Private generic functions
Method, missing-readtable-name: Private generic functions
Method, to-readtable: Private generic functions
missing-readtable-name: Private generic functions
missing-readtable-name: Private generic functions

P
parse-body: Private ordinary functions
parse-ordinary-lambda-list: Private ordinary functions

R
readtable-name: Public ordinary functions
register-readtable: Public compiler macros
register-readtable: Public ordinary functions
rename-readtable: Public ordinary functions
required-argument: Private ordinary functions
reserved-readtable-name-p: Private ordinary functions

S
Setf Expander, (setf find-readtable): Public setf expanders
signal-suspicious-registration-warning: Private ordinary functions
simple-program-error: Private ordinary functions
simple-style-warn: Private ordinary functions

T
to-readtable: Private generic functions
to-readtable: Private generic functions

U
unregister-readtable: Public ordinary functions

W
with-readtable-iterator: Private macros
without-package-lock: Private macros

Jump to:   %   (  
C   D   E   F   G   I   L   M   P   R   S   T   U   W  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   D   E   F   N   P   R   S   T   U  
Index Entry  Section

C
Condition, reader-macro-conflict: Public conditions
Condition, readtable-does-already-exist: Public conditions
Condition, readtable-does-not-exist: Public conditions
Condition, readtable-error: Public conditions
Condition, simple-program-error: Private conditions
Condition, simple-style-warning: Private conditions
cruft.lisp: The named-readtables/cruft․lisp file

D
define-api.lisp: The named-readtables/define-api․lisp file

E
editor-hints.named-readtables: The editor-hints․named-readtables package

F
File, cruft.lisp: The named-readtables/cruft․lisp file
File, define-api.lisp: The named-readtables/define-api․lisp file
File, named-readtables.asd: The named-readtables/named-readtables․asd file
File, named-readtables.lisp: The named-readtables/named-readtables․lisp file
File, package.lisp: The named-readtables/package․lisp file
File, utils.lisp: The named-readtables/utils․lisp file

N
named-readtable-designator: Public types
named-readtables: The named-readtables system
named-readtables.asd: The named-readtables/named-readtables․asd file
named-readtables.lisp: The named-readtables/named-readtables․lisp file

P
Package, editor-hints.named-readtables: The editor-hints․named-readtables package
package.lisp: The named-readtables/package․lisp file

R
reader-macro-conflict: Public conditions
readtable-designator: Private types
readtable-does-already-exist: Public conditions
readtable-does-not-exist: Public conditions
readtable-error: Public conditions

S
simple-program-error: Private conditions
simple-style-warning: Private conditions
System, named-readtables: The named-readtables system

T
Type, named-readtable-designator: Public types
Type, readtable-designator: Private types

U
utils.lisp: The named-readtables/utils․lisp file

Jump to:   C   D   E   F   N   P   R   S   T   U