Common Lisp Object System

The Common Lisp Object System (short: CLOS ) is the object-oriented extension of Common Lisp programming language. It has its origins in Loops and Flavors, and is specified in the ANSI standard for Common Lisp.

CLOS is ( optionally ) by the MetaObject protocol ( MOP ) is implemented. The MOP is not standardized, but many implementations adhere roughly to the specification from the book The Art of MetaObject Protocol ( see references), which is often referred to simply as AMOP.

Properties

CLOS allows the definition of classes with multiple inheritance, methods and generic functions.

Since Common Lisp allows an interactive and incremental development of programs in a runtime environment, also classes can be changed at runtime. This can be achieved by manipulation of the metaobject protocol such as holding the entities of the modified classes consistent. This behavior can be customized by the programmer. In this respect, CLOS is a dynamic and programmable object system.

Another distinctive feature compared to other object-oriented languages ​​such as Smalltalk or Java is the fact that methods are not assigned to classes in CLOS, but separate generic functions.

A generic function includes a lot of methods with different signatures. When calling the generic function for a list of arguments that dynamic method is selected whose signature the most specific match to the arguments. Generic functions are also known as multi-methods, since the right method, not only because of the first argument (in Smalltalk -like object systems often referred to as the receiver of the message) selected, but because the entire argument list. This behavior, which is built into CLOS in an elegant way, is nowadays often replicated in other languages ​​in the form of so-called aspect orientation.

194320
de