Common Lisp the Language, 2nd Edition

Next: Programmer Interface Concepts Up: Common Lisp the Language Previous: Pretty Printing Dispatch

# 28. Common Lisp Object System

By Daniel G. Bobrow, Linda G. DeMichiel, Richard P. Gabriel, Sonya E. Keene, Gregor Kiczales, and David A. Moon

`PREFACE:` X3J13 voted in June 1988 (CLOS) to adopt the first two chapters (of three) of the Common Lisp Object System specification as a part of the forthcoming draft Common Lisp standard.

This chapter presents the bulk of the first two chapters of the Common Lisp Object System specification; it is substantially identical to these two specification chapters as previously published elsewhere [5,6,7]. I have edited the material only very lightly to conform to the overall style of this book and to save a substantial number of pages by using a typographically condensed presentation. I have inserted a small number of bracketed remarks, identified by the initials GLS. The chapter divisions of the original specification have become section divisions in this chapter; references to the three chapters of the original specification now refer to the three ``parts'' of the specification. (See the Acknowledgments to this second edition for acknowledgments to others who contributed to the Common Lisp Object System specification.) This is not the last word on CLOS; X3J13 may well refine this material further. Keene has written a good tutorial introduction to CLOS [26].

> - Guy L. Steele Jr.

- Programmer Interface Concepts
  - Error Terminology
  - Classes
    - Defining Classes
    - Creating Instances of Classes
    - Slots
    - Accessing Slots
  - Inheritance
    - Inheritance of Methods
    - Inheritance of Slots and Slot Options
    - Inheritance of Class Options
    - Examples
  - Integrating Types and Classes
  - Determining the Class Precedence List
    - Topological Sorting
    - Examples
  - Generic Functions and Methods
    - Introduction to Generic Functions
    - Introduction to Methods
    - Agreement on Parameter Specializers and Qualifiers
    - Congruent Lambda-Lists for All Methods of a Generic Function
    - Keyword Arguments in Generic Functions and Methods
  - Method Selection and Combination
    - Determining the Effective Method
    - Standard Method Combination
    - Declarative Method Combination
    - Built-in Method Combination Types
  - Meta-objects
    - Metaclasses
    - Standard Metaclasses
    - Standard Meta-objects
  - Object Creation and Initialization
    - Initialization Arguments
    - Declaring the Validity of Initialization Arguments
    - Defaulting of Initialization Arguments
    - Rules for Initialization Arguments
    - Shared-Initialize
    - Initialize-Instance
    - Definitions of Make-Instance and Initialize-Instance
  - Redefining Classes
    - Modifying the Structure of Instances
    - Initializing Newly Added Local Slots
    - Customizing Class Redefinition
    - Extensions
  - Changing the Class of an Instance
    - Modifying the Structure of an Instance
    - Initializing Newly Added Local Slots
    - Customizing the Change of Class of an Instance
  - Reinitializing an Instance
    - Customizing Reinitialization
- Functions in the Programmer Interface