JUCS - Journal of Universal Computer Science 14(20): 3389-3411, doi: 10.3217/jucs-014-20-3389
Binary Methods Programming: the Clos Perspective
expand article infoDidier Verna
‡ Epita Research and Development Laboratory, Paris, France
Open Access
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).
binary methods, Common Lisp, object orientation, meta-programming