|
Binary Methods Programming: the Clos Perspective
Didier Verna (Epita Research and Development Laboratory, France)
Abstract: Implementing binary methods in traditional object-oriented languages isdifficult. Numerous problems arise regarding the relationship between types and classes in the context of inheritance, or the need for privileged access to the internal repre-sentation of objects. Most of these problems occur in the context of statically typed languages that lack multi-methods (polymorphism on multiple arguments). The pur-pose of this paper is twofold: to show why some of these problems are either non-issues, or easily solved in Common Lisp, and to demonstrate how the Common Lisp ObjectSystem (Clos) allows us to simply define, implement and enforce type-safe binary methods. These last considerations involve re-programming a binary method-specificobject system through the Clos Meta-Object Protocol (Mop).
Keywords: Common Lisp, binary methods, meta-programming, object orientation
Categories: D.1.5, D.3.3
|