Chapter 19
Structures

 19.1 Introduction to Structures
 19.2 How to Use Defstruct
 19.3 Using the Automatically Defined Constructor Function
 19.4 Defstruct Slot-Options
 19.5 Defstruct Options
 19.6 By-Position Constructor Functions
 19.7 Structures of Explicitly Specified Representational Type
  19.7.1 Unnamed Structures
  19.7.2 Named Structures
  19.7.3 Other Aspects of Explicitly Specified Structures

Common Lisp provides a facility for creating named record structures with named components. In effect, the user can define a new data type; every data structure of that type has components with specified names. Constructor, access, and assignment constructs are automatically defined when the data type is defined.

This chapter is divided into two parts. The first part discusses the basics of the structure facility, which is very simple and allows the user to take advantage of the type-checking, modularity, and convenience of user-defined record data types. The second part, beginning with section 19.5, discusses a number of specialized features of the facility that have advanced applications. These features are completely optional, and you needn’t even know they exist in order to take advantage of the basics.