Valid Patterns for Tokens (original) (raw)

ANSI Common Lisp 2 Syntax 2.3 Interpretation of Tokens

2.3.5 Valid Patterns for Tokens

The valid patterns for tokens are summarized in the next figure.

Valid patterns for tokens

nnnnn a number
xxxxx a symbol in the current package
:xxxxx a symbol in the the keyword package
ppppp:xxxxx an external symbol in the ppppp package
ppppp::xxxxx a (possibly internal) symbol in the ppppp package
:nnnnn undefined
ppppp:nnnnn undefined
ppppp::nnnnn undefined
::aaaaa undefined
aaaaa: undefined
aaaaa:aaaaa:aaaaa undefined

Note that nnnnn has number syntax, neither xxxxx nor ppppp has number syntax, and aaaaa has any syntax.

A summary of rules concerning package markers follows. In each case, examples are offered to illustrate the case; for presentational simplicity, the examples assume that the readtable case of the current readtable is :upcase.

For example, assuming the readtable case of the current readtable is :upcase,editor:buffer refers to the _external symbol_named BUFFER present in the package named editor, regardless of whether there is a symbol named BUFFER in the current package. If there is no package namededitor, or if no symbol named BUFFERis present in editor, or if BUFFER is not exported byeditor, the reader signals a correctable error. If editor::buffer is seen, the effect is exactly the same as reading buffer with the editor package being the current package.