×

Object-oriented programming in common LISP. A programmer’s guide to CLOS. (English) Zbl 0743.68118

Reading, MA: Addison-Wesley. XIX, 266 p. (1989).
This book is an introduction to the CLOS model of object-oriented programming. CLOS, the Common Lisp Object System, is a newly designed object-oriented programming language that has evolved as a standard from various object-oriented extensions of the basic Lisp language. The language definition of CLOS comprises a set of tools for developing object-oriented programs in Common Lisp. The book serves two purposes: it is a practical guide to CLOS programming and stands as a tutorial teaching object-oriented techniques for software design and development.
The book starts by describing the central concepts of CLOS: classes (object types), instances (individual objects), slots (attributes of classes or instances), superclasses (hierarchical generalizations of classes), generic functions (as opposed to ordinary Lisp functions) which manipulate objects, and the associated generic dispatch procedure which provides for the implementation that is appropriate for the arguments of the generic function, methods as implementations of generic functions, method roles by which different kinds of methods are distinguished (primary, before-, after-methods), and, finally, the sharing of characteristic (slots) and behavior (methods) among a set of classes by the fundamental inheritance mechanism. The introductory part closes with a comparison of CLOS and Common Lisp features. The book continues with the description of additional techniques and features to the central language model. This includes programming with methods and principles of method inheritance (accessors, multi-methods, methods for Common Lisp types, methods for individual Lisp objects, so-called individual methods), expansions of the CLOS core framework in order to supply direct control mechanisms for the generic dispatch procedure (using various imperative techniques such as around-methods, shadowed primary methods, or method combination types, either built-in or user-defined), class inheritance (considering the specification and alteration of class precedence lists which determine the dominance of any competing traits), facilities for defining and redefining CLOS elements (classes, methods, generic functions), creating and initializing instances (using constructors) as well as controlling the initialization process, and designing procedural definitions.
Two major programming examples illustrate modularity and good design principles, as well as most of the essential CLOS features: a simple CLOS program that implements locks — objects that are used to control concurrent access to some shared resource-, and a more advanced CLOS program that illustrates an object-oriented foundation for implementing Common Lisp streams — abstract channel devices used to transmit data from a source to a destination. The book closes with a survey of the major design goals underlying the development of CLOS: figuring as a standard language extension to Common Lisp that includes the most useful features of related object-oriented languages, providing a powerful, yet flexible programmer interface and an extensible protocol layer to allow for customization of the program’s behavior. Three appendices contain a glossary of CLOS terminology and the syntax of CLOS operators.

MSC:

68T99 Artificial intelligence
68N15 Theory of programming languages
68N01 General topics in the theory of software
68-01 Introductory exposition (textbooks, tutorial papers, etc.) pertaining to computer science
PDFBibTeX XMLCite