CLCS
0
Home
1
Introduction (Introduction)
1.1
Scope
1.1.1
Scope and Purpose
1.1.2
History
1.2
Organization of the Document
1.3
Referenced Publications
1.4
Definitions
1.4.1
Notational Conventions
1.4.1.1
Font Key
1.4.1.2
Modified BNF Syntax
1.4.1.2.1
Splicing in Modified BNF Syntax
1.4.1.2.2
Indirection in Modified BNF Syntax
1.4.1.2.3
Additional Uses for Indirect Definitions in Modified BNF Syntax
1.4.1.3
Special Symbols
1.4.1.4
Objects with Multiple Notations
1.4.1.4.1
Case in Symbols
1.4.1.4.2
Numbers (Objects with Multiple Notations)
1.4.1.4.3
Use of the Dot Character
1.4.1.4.4
nil (Meaning)
1.4.1.12
Designators
1.4.1.13
Nonsense Words
1.4.2
Error Terminology
1.4.3
Sections Not Formally Part Of This Standard
1.4.4
Interpreting Dictionary Entries
1.4.4.1
The "Affected By'' Section of a Dictionary Entry
1.4.4.2
The "Arguments'' Section of a Dictionary Entry
1.4.4.3
The "Arguments and Values'' Section of a Dictionary Entry
1.4.4.4
The "Binding Types Affected'' Section of a Dictionary Entry
1.4.4.5
The "Class Precedence List'' Section of a Dictionary Entry
1.4.4.6
Dictionary Entries for Type Specifiers
1.4.4.6.1
The "Compound Type Specifier Kind" Section of a Dictionary Entry
1.4.4.6.2
The "Compound Type Specifier Syntax" Section of a Dictionary Entry
1.4.4.6.3
The "Compound Type Specifier Arguments'' Section of a Dictionary Entry
1.4.4.6.4
The "Compound Type Specifier Description'' Section of a Dictionary Entry
1.4.4.7
The "Constant Value'' Section of a Dictionary Entry
1.4.4.8
The "Description'' Section of a Dictionary Entry
1.4.4.9
The "Examples'' Section of a Dictionary Entry
1.4.4.10
The "Exceptional Situations'' Section of a Dictionary Entry
1.4.4.11
The "Initial Value'' Section of a Dictionary Entry
1.4.4.12
The "Argument Precedence Order'' Section of a Dictionary Entry
1.4.4.13
The "Method Signature'' Section of a Dictionary Entry
1.4.4.14
The "Name'' Section of a Dictionary Entry
1.4.4.15
The "Notes'' Section of a Dictionary Entry
1.4.4.16
The "Pronunciation'' Section of a Dictionary Entry
1.4.4.17
The "See Also'' Section of a Dictionary Entry
1.4.4.18
The "Side Effects'' Section of a Dictionary Entry
1.4.4.19
The "Supertypes'' Section of a Dictionary Entry
1.4.4.20
The "Syntax'' Section of a Dictionary Entry
1.4.4.20.1
Special "Syntax'' Notations for Overloaded Operators
1.4.4.20.2
Naming Conventions for Rest Parameters
1.4.4.20.3
Requiring Non-Null Rest Parameters in the "Syntax'' Section
1.4.4.20.4
Return values in the "Syntax'' Section
1.4.4.20.5
No Arguments or Values in the "Syntax'' Section
1.4.4.20.6
Unconditional Transfer of Control in the "Syntax'' Section
1.4.4.21
The "Valid Context'' Section of a Dictionary Entry
1.4.4.22
The "Value Type'' Section of a Dictionary Entry
1.5
Conformance
1.5.1
Conforming Implementations
1.5.1.1
Required Language Features
1.5.1.2
Documentation of Implementation-Dependent Features
1.5.1.3
Documentation of Extensions
1.5.1.4
Treatment of Exceptional Situations
1.5.1.5
Resolution of Apparent Conflicts in Exceptional Situations
1.5.1.6
Examples of Resolution of Apparent Conflict in Exceptional Situations
1.5.1.7
Conformance Statement
1.5.2
Conforming Programs
1.5.2.1
Use of Implementation-Defined Language Features
1.5.2.2
Use of Read-Time Conditionals
1.6
Language Extensions
1.7
Language Subsets
1.8
Deprecated Language Features
1.8.1
Deprecated Functions
1.8.2
Deprecated Argument Conventions
1.8.3
Deprecated Variables
1.8.4
Deprecated Reader Syntax
1.9
Symbols in the COMMON-LISP Package
2
Syntax
2.1
Character Syntax
2.1.1
Readtables
2.1.1.1
The Current Readtable
2.1.1.2
The Standard Readtable
2.1.1.3
The Initial Readtable
2.1.2
Variables that affect the Lisp Reader
2.1.3
Standard Characters
2.1.4
Character Syntax Types
2.1.4.1
Constituent Characters
2.1.4.2
Constituent Traits
2.1.4.3
Invalid Characters
2.1.4.4
Macro Characters
2.1.4.5
Multiple Escape Characters
2.1.4.6
Examples of Multiple Escape Characters
2.1.4.7
Single Escape Character
2.1.4.8
Examples of Single Escape Characters
2.1.4.9
Whitespace Characters
2.1.4.10
Examples of Whitespace Characters
2.2
Reader Algorithm
2.3
Interpretation of Tokens
2.3.1
Numbers as Tokens
2.3.1.1
Potential Numbers as Tokens
2.3.1.2
Escape Characters and Potential Numbers
2.3.1.3
Examples of Potential Numbers
2.3.2
Constructing Numbers from Tokens
2.3.2.1
Syntax of a Rational
2.3.2.1.1
Syntax of an Integer
2.3.2.1.2
Syntax of a Ratio
2.3.2.2
Syntax of a Float
2.3.2.3
Syntax of a Complex
2.3.3
The Consing Dot
2.3.4
Symbols as Tokens
2.3.5
Valid Patterns for Tokens
2.3.6
Package System Consistency Rules
2.4
Standard Macro Characters
2.4.1
Left-Parenthesis
2.4.2
Right-Parenthesis
2.4.3
Single-Quote
2.4.3.1
Examples of Single-Quote
2.4.4
Semicolon
2.4.4.1
Examples of Semicolon
2.4.4.2
Notes about Style for Semicolon
2.4.4.3
Use of Single Semicolon
2.4.4.4
Use of Double Semicolon
2.4.4.5
Use of Triple Semicolon
2.4.4.6
Use of Quadruple Semicolon
2.4.4.7
Examples of Style for Semicolon
2.4.5
Double-Quote
2.4.6
Backquote
2.4.6.1
Notes about Backquote
2.4.7
Comma
2.4.8
Sharpsign
2.4.8.1
Sharpsign Backslash
2.4.8.2
Sharpsign Single-Quote
2.4.8.3
Sharpsign Left-Parenthesis
2.4.8.4
Sharpsign Asterisk
2.4.8.5
Examples of Sharpsign Asterisk
2.4.8.6
Sharpsign Colon
2.4.8.7
Sharpsign Dot
2.4.8.8
Sharpsign B
2.4.8.9
Sharpsign O
2.4.8.10
Sharpsign X
2.4.8.11
Sharpsign R
2.4.8.12
Sharpsign C
2.4.8.13
Sharpsign A
2.4.8.14
Sharpsign S
2.4.8.15
Sharpsign P
2.4.8.16
Sharpsign Equal-Sign
2.4.8.17
Sharpsign Sharpsign
2.4.8.18
Sharpsign Plus
2.4.8.19
Sharpsign Minus
2.4.8.20
Sharpsign Vertical-Bar
2.4.8.21
Examples of Sharpsign Vertical-Bar
2.4.8.22
Notes about Style for Sharpsign Vertical-Bar
2.4.8.23
Sharpsign Less-Than-Sign
2.4.8.24
Sharpsign Whitespace
2.4.8.25
Sharpsign Right-Parenthesis
2.4.9
Re-Reading Abbreviated Expressions
3
Evaluation and Compilation
3.1
Evaluation
3.1.1
Introduction to Environments
3.1.1.1
The Global Environment
3.1.1.2
Dynamic Environments
3.1.1.3
Lexical Environments
3.1.1.4
The Null Lexical Environment
3.1.1.5
Environment Objects
3.1.2
The Evaluation Model
3.1.2.1
Form Evaluation
3.1.2.2
Symbols as Forms
3.1.2.3
Lexical Variables
3.1.2.4
Dynamic Variables
3.1.2.5
Constant Variables
3.1.2.6
Symbols Naming Both Lexical and Dynamic Variables
3.1.2.7
Conses as Forms
3.1.2.8
Special Forms
3.1.2.9
Macro Forms
3.1.2.10
Function Forms
3.1.2.11
Lambda forms
3.1.2.12
Self-Evaluating Objects
3.1.2.13
Examples of Self-Evaluating Objects
3.1.3
Lambda Expressions
3.1.4
Closures and Lexical Binding
3.1.5
Shadowing
3.1.6
Extent
3.1.7
Return Values
3.2
Compilation
3.2.1
Compiler Terminology
3.2.2
Compilation Semantics
3.2.2.1
Compiler Macros
3.2.2.2
Purpose of Compiler Macros
3.2.2.3
Naming of Compiler Macros
3.2.2.4
When Compiler Macros Are Used
3.2.2.5
Notes about the Implementation of Compiler Macros
3.2.2.6
Minimal Compilation
3.2.2.7
Semantic Constraints
3.2.3
File Compilation
3.2.3.1
Processing of Top Level Forms
3.2.3.2
Processing of Defining Macros
3.2.3.3
Constraints on Macros and Compiler Macros
3.2.4
Literal Objects in Compiled Files
3.2.4.1
Externalizable Objects
3.2.4.2
Similarity of Literal Objects
3.2.4.3
Similarity of Aggregate Objects
3.2.4.4
Definition of Similarity
3.2.4.5
Extensions to Similarity Rules
3.2.4.6
Additional Constraints on Externalizable Objects
3.2.5
Exceptional Situations in the Compiler
3.3
Declarations
3.3.1
Minimal Declaration Processing Requirements
3.3.2
Declaration Specifiers
3.3.3
Declaration Identifiers
3.3.3.1
Shorthand notation for Type Declarations
3.3.4
Declaration Scope
3.3.4.1
Examples of Declaration Scope
3.4
Lambda Lists
3.4.1
Ordinary Lambda Lists
3.4.1.1
Specifiers for the required parameters
3.4.1.2
Specifiers for optional parameters
3.4.1.3
A specifier for a rest parameter
3.4.1.4
Specifiers for keyword parameters
3.4.1.5
Suppressing Keyword Argument Checking
3.4.1.6
Examples of Suppressing Keyword Argument Checking
3.4.1.7
Specifiers for &aux variables
3.4.1.8
Examples of Ordinary Lambda Lists
3.4.2
Generic Function Lambda Lists
3.4.3
Specialized Lambda Lists
3.4.4
Macro Lambda Lists
3.4.4.1
Destructuring by Lambda Lists
3.4.4.2
Data-directed Destructuring by Lambda Lists
3.4.4.3
Examples of Data-directed Destructuring by Lambda Lists
3.4.4.4
Lambda-list-directed Destructuring by Lambda Lists
3.4.5
Destructuring Lambda Lists
3.4.6
Boa Lambda Lists
3.4.7
Defsetf Lambda Lists
3.4.8
Deftype Lambda Lists
3.4.9
Define-modify-macro Lambda Lists
3.4.10
Define-method-combination Arguments Lambda Lists
3.4.11
Syntactic Interaction of Documentation Strings and Declarations
3.5
Error Checking in Function Calls
3.5.1
Argument Mismatch Detection
3.5.1.1
Safe and Unsafe Calls
3.5.1.2
Error Detection Time in Safe Calls
3.5.1.3
Too Few Arguments
3.5.1.4
Too Many Arguments
3.5.1.5
Unrecognized Keyword Arguments
3.5.1.6
Invalid Keyword Arguments
3.5.1.7
Odd Number of Keyword Arguments
3.5.1.8
Destructuring Mismatch
3.5.1.9
Errors When Calling a Next Method
3.6
Traversal Rules and Side Effects
3.7
Destructive Operations
3.7.1
Modification of Literal Objects
3.7.2
Transfer of Control during a Destructive Operation
3.7.2.1
Examples of Transfer of Control during a Destructive Operation
3.8
Evaluation and Compilation Dictionary
3.8.1
lambda (Symbol)
3.8.2
lambda
3.8.3
compile
3.8.4
eval
3.8.5
eval-when
3.8.6
load-time-value
3.8.7
quote
3.8.8
compiler-macro-function
3.8.9
define-compiler-macro
3.8.10
defmacro
3.8.11
macro-function
3.8.12
macroexpand
3.8.13
define-symbol-macro
3.8.14
symbol-macrolet
3.8.15
*macroexpand-hook*
3.8.16
proclaim
3.8.17
declaim
3.8.18
declare
3.8.19
ignore
3.8.20
dynamic-extent
3.8.21
type
3.8.22
inline
3.8.23
ftype
3.8.24
declaration
3.8.25
optimize
3.8.26
special
3.8.27
locally
3.8.28
the
3.8.29
special-operator-p
3.8.30
constantp
4
Types and Classes
4.1
Introduction (Types and Classes)
4.2
Types
4.2.1
Data Type Definition
4.2.2
Type Relationships
4.2.3
Type Specifiers
4.3
Classes
4.3.1
Introduction to Classes
4.3.1.1
Standard Metaclasses
4.3.2
Defining Classes
4.3.3
Creating Instances of Classes
4.3.4
Inheritance
4.3.4.1
Examples of Inheritance
4.3.4.2
Inheritance of Class Options
4.3.5
Determining the Class Precedence List
4.3.5.1
Topological Sorting
4.3.5.2
Examples of Class Precedence List Determination
4.3.6
Redefining Classes
4.3.6.1
Modifying the Structure of Instances
4.3.6.2
Initializing Newly Added Local Slots (Redefining Classes)
4.3.6.3
Customizing Class Redefinition
4.3.7
Integrating Types and Classes
4.4
Types and Classes Dictionary
4.4.1
nil (Type)
4.4.2
boolean
4.4.3
function (System Class)
4.4.4
compiled-function
4.4.5
generic-function
4.4.6
standard-generic-function
4.4.7
class
4.4.8
built-in-class
4.4.9
structure-class
4.4.10
standard-class
4.4.11
method
4.4.12
standard-method
4.4.13
structure-object
4.4.14
standard-object
4.4.15
method-combination
4.4.16
t (System Class)
4.4.17
satisfies
4.4.18
member
4.4.19
not (Type Specifier)
4.4.20
and (Type Specifier)
4.4.21
or (Type Specifier)
4.4.22
values (Type Specifier)
4.4.23
eql (Type Specifier)
4.4.24
coerce
4.4.25
deftype
4.4.26
subtypep
4.4.27
type-of
4.4.28
typep
4.4.29
type-error
4.4.30
type-error-datum
4.4.31
simple-type-error
5
Data and Control Flow
5.1
Generalized Reference
5.1.1
Overview of Places and Generalized Reference
5.1.1.1
Evaluation of Subforms to Places
5.1.1.2
Examples of Evaluation of Subforms to Places
5.1.1.3
Setf Expansions
5.1.1.4
Examples of Setf Expansions
5.1.2
Kinds of Places
5.1.2.1
Variable Names as Places
5.1.2.2
Function Call Forms as Places
5.1.2.3
VALUES Forms as Places
5.1.2.4
THE Forms as Places
5.1.2.5
APPLY Forms as Places
5.1.2.6
Setf Expansions and Places
5.1.2.7
Macro Forms as Places
5.1.2.8
Symbol Macros as Places
5.1.2.9
Other Compound Forms as Places
5.1.3
Treatment of Other Macros Based on SETF
5.2
Transfer of Control to an Exit Point
5.3
Data and Control Flow Dictionary
5.3.1
apply
5.3.2
defun
5.3.3
fdefinition
5.3.4
fboundp
5.3.5
fmakunbound
5.3.6
flet
5.3.7
funcall
5.3.8
function (Special Operator)
5.3.9
function-lambda-expression
5.3.10
functionp
5.3.11
compiled-function-p
5.3.12
call-arguments-limit
5.3.13
lambda-list-keywords
5.3.14
lambda-parameters-limit
5.3.15
defconstant
5.3.16
defparameter
5.3.17
destructuring-bind
5.3.18
let
5.3.19
progv
5.3.20
setq
5.3.21
psetq
5.3.22
block
5.3.23
catch
5.3.24
go
5.3.25
return-from
5.3.26
return
5.3.27
tagbody
5.3.28
throw
5.3.29
unwind-protect
5.3.30
nil (Constant Variable)
5.3.31
not
5.3.32
t
5.3.33
eq
5.3.34
eql
5.3.35
equal
5.3.36
equalp
5.3.37
identity
5.3.38
complement
5.3.39
constantly
5.3.40
every
5.3.41
and
5.3.42
cond
5.3.43
if
5.3.44
or
5.3.45
when
5.3.46
case
5.3.47
typecase
5.3.48
multiple-value-bind
5.3.49
multiple-value-call
5.3.50
multiple-value-list
5.3.51
multiple-value-prog1
5.3.52
multiple-value-setq
5.3.53
values
5.3.54
values-list
5.3.55
multiple-values-limit
5.3.56
nth-value
5.3.57
prog
5.3.58
prog1
5.3.59
progn
5.3.60
define-modify-macro
5.3.61
defsetf
5.3.62
define-setf-expander
5.3.63
get-setf-expansion
5.3.64
setf
5.3.65
shiftf
5.3.66
rotatef
5.3.67
control-error
5.3.68
program-error
5.3.69
undefined-function
6
Iteration
6.1
The LOOP Facility
6.1.1
Overview of the Loop Facility
6.1.1.1
Simple vs Extended Loop
6.1.1.1.1
Simple Loop
6.1.1.1.2
Extended Loop
6.1.1.2
Loop Keywords
6.1.1.3
Parsing Loop Clauses
6.1.1.4
Expanding Loop Forms
6.1.1.5
Summary of Loop Clauses
6.1.1.5.1
Summary of Variable Initialization and Stepping Clauses
6.1.1.5.2
Summary of Value Accumulation Clauses
6.1.1.5.3
Summary of Termination Test Clauses
6.1.1.5.4
Summary of Unconditional Execution Clauses
6.1.1.5.5
Summary of Conditional Execution Clauses
6.1.1.5.6
Summary of Miscellaneous Clauses
6.1.1.6
Order of Execution
6.1.1.7
Destructuring
6.1.1.8
Restrictions on Side-Effects
6.1.2
Variable Initialization and Stepping Clauses
6.1.2.1
Iteration Control
6.1.2.2
The for-as-arithmetic subclause
6.1.2.3
Examples of for-as-arithmetic subclause
6.1.2.4
The for-as-in-list subclause
6.1.2.5
Examples of for-as-in-list subclause
6.1.2.6
The for-as-on-list subclause
6.1.2.7
Examples of for-as-on-list subclause
6.1.2.8
The for-as-equals-then subclause
6.1.2.9
Examples of for-as-equals-then subclause
6.1.2.10
The for-as-across subclause
6.1.2.11
Examples of for-as-across subclause
6.1.2.12
The for-as-hash subclause
6.1.2.13
The for-as-package subclause
6.1.2.14
Examples of for-as-package subclause
6.1.2.15
Local Variable Initializations
6.1.2.16
Examples of WITH clause
6.1.3
Value Accumulation Clauses
6.1.3.1
Examples of COLLECT clause
6.1.3.2
Examples of APPEND and NCONC clauses
6.1.3.3
Examples of COUNT clause
6.1.3.4
Examples of MAXIMIZE and MINIMIZE clauses
6.1.3.5
Examples of SUM clause
6.1.4
Termination Test Clauses
6.1.4.1
Examples of REPEAT clause
6.1.4.2
Examples of ALWAYS
6.1.4.3
Examples of WHILE and UNTIL clauses
6.1.5
Unconditional Execution Clauses
6.1.5.1
Examples of unconditional execution
6.1.6
Conditional Execution Clauses
6.1.6.1
Examples of WHEN clause
6.1.7
Miscellaneous Clauses
6.1.7.1
Control Transfer Clauses
6.1.7.2
Examples of NAMED clause
6.1.7.3
Initial and Final Execution
6.1.8
Examples of Miscellaneous Loop Features
6.1.8.1
Examples of clause grouping
6.1.9
Notes about Loop
6.2
Iteration Dictionary
6.2.1
do
6.2.2
dotimes
6.2.3
dolist
6.2.4
loop
6.2.5
loop-finish
7
Objects
7.1
Object Creation and Initialization
7.1.1
Initialization Arguments
7.1.2
Declaring the Validity of Initialization Arguments
7.1.3
Defaulting of Initialization Arguments
7.1.4
Rules for Initialization Arguments
7.1.7
Definitions of Make-Instance and Initialize-Instance
7.2
Changing the Class of an Instance
7.2.1
Modifying the Structure of the Instance
7.2.2
Initializing Newly Added Local Slots (Changing the Class of an Instance)
7.2.3
Customizing the Change of Class of an Instance
7.3
Reinitializing an Instance
7.3.1
Customizing Reinitialization
7.4
Meta-Objects
7.4.1
Standard Meta-objects
7.5
Slots
7.5.1
Introduction to Slots
7.5.2
Accessing Slots
7.5.3
Inheritance of Slots and Slot Options
7.6
Generic Functions and Methods
7.6.1
Introduction to Generic Functions
7.6.2
Introduction to Methods
7.6.3
Agreement on Parameter Specializers and Qualifiers
7.6.4
Congruent Lambda-lists for all Methods of a Generic Function
7.6.5
Keyword Arguments in Generic Functions and Methods
7.6.5.1
Examples of Keyword Arguments in Generic Functions and Methods
7.6.6
Method Selection and Combination
7.6.6.1
Determining the Effective Method
7.6.6.2
Selecting the Applicable Methods
7.6.6.3
Sorting the Applicable Methods by Precedence Order
7.6.6.4
Applying method combination to the sorted list of applicable methods
7.6.6.5
Standard Method Combination
7.6.6.6
Declarative Method Combination
7.6.6.7
Built-in Method Combination Types
7.6.7
Inheritance of Methods
7.7
Objects Dictionary
7.7.1
function-keywords
7.7.2
ensure-generic-function
7.7.3
allocate-instance
7.7.4
reinitialize-instance
7.7.5
shared-initialize
7.7.6
update-instance-for-different-class
7.7.7
update-instance-for-redefined-class
7.7.8
change-class
7.7.9
slot-boundp
7.7.10
slot-exists-p
7.7.11
slot-makunbound
7.7.12
slot-missing
7.7.13
slot-unbound
7.7.14
slot-value
7.7.15
method-qualifiers
7.7.16
no-applicable-method
7.7.17
no-next-method
7.7.18
remove-method
7.7.19
make-instance
7.7.20
make-instances-obsolete
7.7.21
make-load-form
7.7.22
make-load-form-saving-slots
7.7.23
with-accessors
7.7.24
with-slots
7.7.25
defclass
7.7.26
defgeneric
7.7.27
defmethod
7.7.28
find-class
7.7.29
next-method-p
7.7.30
call-method
7.7.31
call-next-method
7.7.32
compute-applicable-methods
7.7.33
define-method-combination
7.7.34
find-method
7.7.35
add-method
7.7.36
initialize-instance
7.7.37
class-name
7.7.38
(setf class-name)
7.7.39
class-of
7.7.40
unbound-slot
7.7.41
unbound-slot-instance
8
Structures
8.1
Structures Dictionary
8.1.1
defstruct
8.1.2
copy-structure
9
Conditions
9.1
Condition System Concepts
9.1.1
Condition Types
9.1.1.1
Serious Conditions
9.1.2
Creating Conditions
9.1.2.1
Condition Designators
9.1.3
Printing Conditions
9.1.3.1
Recommended Style in Condition Reporting
9.1.3.2
Capitalization and Punctuation in Condition Reports
9.1.3.3
Leading and Trailing Newlines in Condition Reports