In most OOP languages, methods belong to classes and are invoked by sending messages. In CLOS, methods belong to generic functions instead of classes, and those generic functions select and execute the correct method according to the types of the arguments they receive.

The CLOS Metaobject Protocol (MOP) specifies how its essential building blocks are to be implemented in CLOS itself. This allows extending its object model with metaclasses that change important aspects of CLOS for a well-defined scope.

This presentation introduces these two notions. The code for an interpreter for generic functions that performs selection and execution of methods will be developed live during the presentation. This will be followed by a discussion how that code can be extended to introduce, for example, multimethods and AOP-style advices, and a sketch how generic functions are implemented efficiently in the "real" world. In the second part, the extensibility of the CLOS MOP will be illustrated by implementing - live - the (hashtable-based) Python object model as a metaclass. Other practical extensions based on the CLOS MOP are also sketched, like object-relational mappings, interfaces to foreign-language objects, and domain-specific annotations in classes.

Biography: Pascal Costanza has a Ph.D. degree from the University of Bonn, Germany. His past involvements include specification and implementation of the languages Gilgul and Lava, and the design and application of the JMangler framework for load-time transformation of Java class files. He has also implemented ContextL, the first programming language extension for Context-oriented Programming based on CLOS, and aspect-oriented extensions for CLOS, which all heavily rely on the CLOS MOP. He is furthermore the initiator and lead of Closer, an open source project that provides a compatibility layer for the CLOS MOP across multiple Common Lisp implementations.