The advanced-readtable Reference Manual

This is the advanced-readtable Reference Manual, version 1.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 14:31:08 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 advanced-readtable

Advanced customizable readtable

Author

Roman Klochkov <>

License

BSD

Version

1.0.1

Dependency

named-readtables (system).

Source

advanced-readtable.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 advanced-readtable/advanced-readtable.asd

Source

advanced-readtable.asd.

Parent Component

advanced-readtable (system).

ASDF Systems

advanced-readtable.


3.1.2 advanced-readtable/package.lisp

Source

advanced-readtable.asd.

Parent Component

advanced-readtable (system).

Packages

advanced-readtable.


3.1.3 advanced-readtable/finders.lisp

Dependency

package.lisp (file).

Source

advanced-readtable.asd.

Parent Component

advanced-readtable (system).

Public Interface
Internals

3.1.4 advanced-readtable/api.lisp

Dependency

finders.lisp (file).

Source

advanced-readtable.asd.

Parent Component

advanced-readtable (system).

Public Interface
Internals

3.1.5 advanced-readtable/readtable.lisp

Dependency

api.lisp (file).

Source

advanced-readtable.asd.

Parent Component

advanced-readtable (system).

Packages

advanced-readtable.junk.

Public Interface
Internals

3.1.6 advanced-readtable/hierarchy.lisp

Dependency

readtable.lisp (file).

Source

advanced-readtable.asd.

Parent Component

advanced-readtable (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 advanced-readtable

Source

package.lisp.

Use List
  • common-lisp.
  • editor-hints.named-readtables.
Public Interface
Internals

4.2 advanced-readtable.junk

Source

readtable.lisp.


5 Definitions

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


5.1 Public Interface


5.1.1 Special variables

Special Variable: *enable-symbol-readmacro*

Enables processing of symbol-readmacro.

Package

advanced-readtable.

Source

readtable.lisp.

Special Variable: *extra-finders*

Hash symbol -> alist (key . symbol-handler)
Used for PUSH-LOCAL-PACKAGE. It will be searched before CL:FIND-SYMBOL. Will be checked inside list, where car of list eq SYMBOL.

Package

advanced-readtable.

Source

finders.lisp.

Special Variable: *package-finders*

Alist (equal key . package-handler). Contains global handlers for FIND-PACKAGE.

Package

advanced-readtable.

Source

finders.lisp.

Special Variable: *symbol-finders*

Alist (equal key . symbol-handler). Contains global handlers for FIND-SYMBOL.

Package

advanced-readtable.

Source

finders.lisp.


5.1.2 Macros

Macro: defpackage (package &rest options)
Package

advanced-readtable.

Source

hierarchy.lisp.

Macro: in-package (designator)
Package

advanced-readtable.

Source

hierarchy.lisp.

Macro: set-handler (handler-list key function)

This is middle-level public API for changing handlers for
find-symbol and find-package. There are five lists:
*package-finders* – global for find-package
*symbol-finders* – global for find-symbol
(package-finders package) – per-package for find-package (symbol-finders package) – per-package for find-symbol
(extra-finders symbol) – per-symbol for (symbol ....) package substitution

Key should be uniq in the sense of EQUAL in the list. SET-HANDLER adds new handler if it is not already there.

Package

advanced-readtable.

Source

finders.lisp.


5.1.3 Ordinary functions

Function: ! ()
Package

advanced-readtable.

Source

readtable.lisp.

Function: !! ()
Package

advanced-readtable.

Source

hierarchy.lisp.

Function: activate ()
Package

advanced-readtable.

Source

readtable.lisp.

Function: activate-cl-substitutes ()
Package

advanced-readtable.

Source

hierarchy.lisp.

Function: find-package (name &optional current-package)

We try to find package.
1. By full name with CL:FIND-PACKAGE.
2. By per-package handlers. Here we wil try local-nicknames and so on. 3. By global handlers. Here we may use, for example, hierarchical packages.

Package

advanced-readtable.

Source

finders.lisp.

Function: find-symbol (name &optional dpackage)

We try to find symbol
1. In package set with car of list, for example, PUSH-LOCAL-PACKAGE 2. By CL:FIND-SYMBOL, when package explicitly given
3. By packages added with package:(...)
4. By per-package finders
5. By global finders
6. By CL:FIND-SYMBOL

Package

advanced-readtable.

Source

finders.lisp.

Function: get-macro-symbol (symbol)

Syntax is like get-macro-character. Returns function, assigned by set-macro-symbol

Package

advanced-readtable.

Source

finders.lisp.

Function: package-finders (&optional package)

Returns alist (key . package-handler) for package

Package

advanced-readtable.

Source

finders.lisp.

Function: (setf package-finders) (&optional package)

Sets alist (key . package-handler) for package

Package

advanced-readtable.

Source

finders.lisp.

Function: push-import-prefix (prefix &optional package)

Enables using package name omitting prefix.
For example, you have packages com.clearly-useful.iterator-protocol, com.clearly-useful.reducers, ... You may use them as
(push-import-prefix :com.clearly-useful)
(iterator-protocol:do-iterator ...)
(reducers:r/map #’1+ data)
and so on.
Package prefix is enabled per package so it is safe to use it in your package.

If there is package, which name coincides with shortcut, package name has priority.

So, if you make
(defpackage :reducers ...)

after that reducers:... will refer to new package, not com.clearly-useful.reducers.

Package

advanced-readtable.

Source

api.lisp.

Function: push-local-nickname (long-package nick &optional current-package)

Enables package nickname in CURRENT-PACKAGE.
For example, you found COM.INFORMATIMAGO.COMMON-LISP.CESARUM.LIST package and want to use it. But don’t want to USE-PACKAGE them, because some exported symbols from it are clashing with yours.

You may do it right:
(push-local-nickname :com.informatimago.common-lisp.cesarum.list :ilist) (ilist:circular-length l)

Local-nicknames are local, so you may use it freely.

If package A wants package LIB version 1, and package B wants package
LIB version 2, one can simply rename LIB version 1 to LIB1 and rename LIB
version 2 to LIB2 and make
(push-local-nickname :lib1 :lib :a)
(push-local-nickname :lib2 :lib :b)

If enabled global-nicknames via enable-global-nicknames,
then also created alias in current package.

For example,
(push-local-nickname :lib1 :lib :a), states, that package A.LIB is eq to LIB1.

Package

advanced-readtable.

Source

api.lisp.

Function: push-local-package (symbol local-package)

Sets local-package for a symbol. Many macroses use there own clauses. For example, ITERATE uses FOR, COLLECT and so on.
If you don’t want to USE-PACKAGE iterate, this function will help. (push-local-package ’iter:iter :iterate)
(iter:iter (for i from 1 to 10) (collect i))

Caution: this function enables package substitution in all cases, where SYMBOL is the car of a list.
For example, this will be error:
(let (iter:iter for) (list iter:iter for))
, because first for is in ITERATE package, but second – is not.

Package

advanced-readtable.

Source

api.lisp.

Function: read-token-with-colons (stream char)

Reads token, then analize package part if needed

Package

advanced-readtable.

Source

readtable.lisp.

Function: set-macro-symbol (symbol func)

Syntax is like set-macro-character,
except that FUNC is binded to SYMBOL, not character

Package

advanced-readtable.

Source

finders.lisp.

Function: symbol-finders (&optional package)

Returns alist (key . symbol-handler) for package

Package

advanced-readtable.

Source

finders.lisp.

Function: (setf symbol-finders) (&optional package)

Sets alist (key . symbol-handler) for package

Package

advanced-readtable.

Source

finders.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *car-list*

Boolean: iff reader in list and car is not read

Package

advanced-readtable.

Source

readtable.lisp.

Special Variable: *colon-readtable*

Support readtable with colon as whitespace

Package

advanced-readtable.

Source

readtable.lisp.

Special Variable: *current-extra-finders*

Alist (key . symbol-handler). Used in PUSH-LOCAL-PACKAGE processing

Package

advanced-readtable.

Source

finders.lisp.

Special Variable: *global-nicknames*

Package aliases. Hash nickname: string -> package

Package

advanced-readtable.

Source

api.lisp.

Special Variable: *local-package-finders*

Hash package -> alist (key . package-handler). Contains per-package handlers for FIND-PACKAGE.

Package

advanced-readtable.

Source

finders.lisp.

Special Variable: *local-packages*

List of packages: for pack:( ... pack2:(...))

Package

advanced-readtable.

Source

finders.lisp.

Special Variable: *local-symbol-finders*

Hash package -> alist (equal key . symbol-handler). Contains per-package handlers for FIND-SYMBOL.

Package

advanced-readtable.

Source

finders.lisp.

Special Variable: *symbol-readmacros*

Hash symbol -> macro-symbol-handler Contans handlers for macro-symbols.

Package

advanced-readtable.

Source

finders.lisp.

Special Variable: +additional-chars+

Fill this, if you need extra characters for packages to begin with

Package

advanced-readtable.

Source

readtable.lisp.


5.2.2 Macros

Macro: %set-handler (handler-list key name &body handler-body)

Local macros for push-* functions. No gensyms intended.

Package

advanced-readtable.

Source

api.lisp.

Macro: with-case (case &body body)
Package

advanced-readtable.

Source

readtable.lisp.


5.2.3 Ordinary functions

Function: chars-to-process ()
Package

advanced-readtable.

Source

readtable.lisp.

Function: collect-dots (stream)
Package

advanced-readtable.

Source

readtable.lisp.

Function: correct-package (designator)
Package

advanced-readtable.

Source

hierarchy.lisp.

Function: count-colons (stream)

DO: Reads colons from STREAM RETURN: number of the colons

Package

advanced-readtable.

Source

readtable.lisp.

Function: does-not-terminate-token-p (c)
Package

advanced-readtable.

Source

readtable.lisp.

Function: extra-finders (symbol)

Returns alist (key . symbol-handler) for symbol

Package

advanced-readtable.

Source

finders.lisp.

Function: (setf extra-finders) (symbol)

Sets alist (key . symbol-handler) for symbol

Package

advanced-readtable.

Source

finders.lisp.

Function: find-local-packages (packages name)
Package

advanced-readtable.

Source

finders.lisp.

Function: funcall-first (handlers-list name package)

HANDLERS-LIST – alist (key . package-handler).
The function calls handlers until one of them returns not null. Then the result of last call is returned

Package

advanced-readtable.

Source

finders.lisp.

Function: funcall-first-mv (handlers-list name package)

HANDLERS-LIST – alist (key . package-handler).
The function calls handlers until one of them returns not null. Then the result of last call is returned

Package

advanced-readtable.

Source

finders.lisp.

Function: hierarchy-find-package (name package)
Package

advanced-readtable.

Source

hierarchy.lisp.

Function: macro-char-p (c)

If C is macro-char, return GET-MACRO-CHARACTER

Package

advanced-readtable.

Source

readtable.lisp.

Function: multiple-escape-p (c)
Package

advanced-readtable.

Source

readtable.lisp.

Function: normalize-package (name)

Returns nil if already normalized.
Replace first section of hierarchy with proper name

Package

advanced-readtable.

Source

hierarchy.lisp.

Function: open-paren-reader (stream char)
Package

advanced-readtable.

Source

readtable.lisp.

Function: process-local-nicknames (package pairs)
Package

advanced-readtable.

Source

hierarchy.lisp.

Function: process-symbol-readmacro (stream symbol)
Package

advanced-readtable.

Source

readtable.lisp.

Function: read-after-colon (stream maybe-package colons)

Read symbol package:sym or list package:(...)

Package

advanced-readtable.

Source

readtable.lisp.

Function: read-token (stream)

DO: Reads from STREAM a symbol or number up to whitespace or colon RETURN: symbols name or numbers value

Package

advanced-readtable.

Source

readtable.lisp.

Function: single-escape-p (c)
Package

advanced-readtable.

Source

readtable.lisp.

Function: substitute-symbol (stream symbol)
Package

advanced-readtable.

Source

hierarchy.lisp.

Function: to-process (c)
Package

advanced-readtable.

Source

readtable.lisp.

Function: whitespace-p (c)
Package

advanced-readtable.

Source

readtable.lisp.


5.2.4 Types

Type: macro-symbol-handler ()

Handler for SET/GET-MACRO-SYMBOL

Package

advanced-readtable.

Source

finders.lisp.

Type: package-designator ()

Argument of CL:FIND-PACKAGE

Package

advanced-readtable.

Source

finders.lisp.

Type: package-handler ()

Type of handlers for package finding.
First arg is a name to find. Second – current package

Package

advanced-readtable.

Source

finders.lisp.

Type: symbol-handler ()

Type of handlers for symbol finding
First arg is a name to find. Second – current package

Package

advanced-readtable.

Source

finders.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   !   %   (  
A   C   D   E   F   G   H   I   M   N   O   P   R   S   T   W  
Index Entry  Section

!
!: Public ordinary functions
!!: Public ordinary functions

%
%set-handler: Private macros

(
(setf extra-finders): Private ordinary functions
(setf package-finders): Public ordinary functions
(setf symbol-finders): Public ordinary functions

A
activate: Public ordinary functions
activate-cl-substitutes: Public ordinary functions

C
chars-to-process: Private ordinary functions
collect-dots: Private ordinary functions
correct-package: Private ordinary functions
count-colons: Private ordinary functions

D
defpackage: Public macros
does-not-terminate-token-p: Private ordinary functions

E
extra-finders: Private ordinary functions

F
find-local-packages: Private ordinary functions
find-package: Public ordinary functions
find-symbol: Public ordinary functions
funcall-first: Private ordinary functions
funcall-first-mv: Private ordinary functions
Function, !: Public ordinary functions
Function, !!: Public ordinary functions
Function, (setf extra-finders): Private ordinary functions
Function, (setf package-finders): Public ordinary functions
Function, (setf symbol-finders): Public ordinary functions
Function, activate: Public ordinary functions
Function, activate-cl-substitutes: Public ordinary functions
Function, chars-to-process: Private ordinary functions
Function, collect-dots: Private ordinary functions
Function, correct-package: Private ordinary functions
Function, count-colons: Private ordinary functions
Function, does-not-terminate-token-p: Private ordinary functions
Function, extra-finders: Private ordinary functions
Function, find-local-packages: Private ordinary functions
Function, find-package: Public ordinary functions
Function, find-symbol: Public ordinary functions
Function, funcall-first: Private ordinary functions
Function, funcall-first-mv: Private ordinary functions
Function, get-macro-symbol: Public ordinary functions
Function, hierarchy-find-package: Private ordinary functions
Function, macro-char-p: Private ordinary functions
Function, multiple-escape-p: Private ordinary functions
Function, normalize-package: Private ordinary functions
Function, open-paren-reader: Private ordinary functions
Function, package-finders: Public ordinary functions
Function, process-local-nicknames: Private ordinary functions
Function, process-symbol-readmacro: Private ordinary functions
Function, push-import-prefix: Public ordinary functions
Function, push-local-nickname: Public ordinary functions
Function, push-local-package: Public ordinary functions
Function, read-after-colon: Private ordinary functions
Function, read-token: Private ordinary functions
Function, read-token-with-colons: Public ordinary functions
Function, set-macro-symbol: Public ordinary functions
Function, single-escape-p: Private ordinary functions
Function, substitute-symbol: Private ordinary functions
Function, symbol-finders: Public ordinary functions
Function, to-process: Private ordinary functions
Function, whitespace-p: Private ordinary functions

G
get-macro-symbol: Public ordinary functions

H
hierarchy-find-package: Private ordinary functions

I
in-package: Public macros

M
Macro, %set-handler: Private macros
Macro, defpackage: Public macros
Macro, in-package: Public macros
Macro, set-handler: Public macros
Macro, with-case: Private macros
macro-char-p: Private ordinary functions
multiple-escape-p: Private ordinary functions

N
normalize-package: Private ordinary functions

O
open-paren-reader: Private ordinary functions

P
package-finders: Public ordinary functions
process-local-nicknames: Private ordinary functions
process-symbol-readmacro: Private ordinary functions
push-import-prefix: Public ordinary functions
push-local-nickname: Public ordinary functions
push-local-package: Public ordinary functions

R
read-after-colon: Private ordinary functions
read-token: Private ordinary functions
read-token-with-colons: Public ordinary functions

S
set-handler: Public macros
set-macro-symbol: Public ordinary functions
single-escape-p: Private ordinary functions
substitute-symbol: Private ordinary functions
symbol-finders: Public ordinary functions

T
to-process: Private ordinary functions

W
whitespace-p: Private ordinary functions
with-case: Private macros


A.3 Variables

Jump to:   *   +  
S  
Index Entry  Section

*
*car-list*: Private special variables
*colon-readtable*: Private special variables
*current-extra-finders*: Private special variables
*enable-symbol-readmacro*: Public special variables
*extra-finders*: Public special variables
*global-nicknames*: Private special variables
*local-package-finders*: Private special variables
*local-packages*: Private special variables
*local-symbol-finders*: Private special variables
*package-finders*: Public special variables
*symbol-finders*: Public special variables
*symbol-readmacros*: Private special variables

+
+additional-chars+: Private special variables

S
Special Variable, *car-list*: Private special variables
Special Variable, *colon-readtable*: Private special variables
Special Variable, *current-extra-finders*: Private special variables
Special Variable, *enable-symbol-readmacro*: Public special variables
Special Variable, *extra-finders*: Public special variables
Special Variable, *global-nicknames*: Private special variables
Special Variable, *local-package-finders*: Private special variables
Special Variable, *local-packages*: Private special variables
Special Variable, *local-symbol-finders*: Private special variables
Special Variable, *package-finders*: Public special variables
Special Variable, *symbol-finders*: Public special variables
Special Variable, *symbol-readmacros*: Private special variables
Special Variable, +additional-chars+: Private special variables


A.4 Data types

Jump to:   A   F   H   M   P   R   S   T  
Index Entry  Section

A
advanced-readtable: The advanced-readtable system
advanced-readtable: The advanced-readtable package
advanced-readtable.asd: The advanced-readtable/advanced-readtable․asd file
advanced-readtable.junk: The advanced-readtable․junk package
api.lisp: The advanced-readtable/api․lisp file

F
File, advanced-readtable.asd: The advanced-readtable/advanced-readtable․asd file
File, api.lisp: The advanced-readtable/api․lisp file
File, finders.lisp: The advanced-readtable/finders․lisp file
File, hierarchy.lisp: The advanced-readtable/hierarchy․lisp file
File, package.lisp: The advanced-readtable/package․lisp file
File, readtable.lisp: The advanced-readtable/readtable․lisp file
finders.lisp: The advanced-readtable/finders․lisp file

H
hierarchy.lisp: The advanced-readtable/hierarchy․lisp file

M
macro-symbol-handler: Private types

P
Package, advanced-readtable: The advanced-readtable package
Package, advanced-readtable.junk: The advanced-readtable․junk package
package-designator: Private types
package-handler: Private types
package.lisp: The advanced-readtable/package․lisp file

R
readtable.lisp: The advanced-readtable/readtable․lisp file

S
symbol-handler: Private types
System, advanced-readtable: The advanced-readtable system

T
Type, macro-symbol-handler: Private types
Type, package-designator: Private types
Type, package-handler: Private types
Type, symbol-handler: Private types