Published April 24, 2023 | Version v1
Conference paper Open

A MOP-Based Implementation for Method Combinations

  • 1. EPITA / LRDE

Description

In traditional object-oriented languages, the dynamic dispatch algorithm is hardwired to select and execute the most specific method in a polymorphic call. In CLOS, the Common Lisp Object System, an abstraction known as "method combinations" allows the programmer to define their own dispatch scheme. When
Common Lisp was standardized, method combinations were not mature enough to be fully specified.

In 2018, using SBCL as a research vehicle, we analyzed the unfortunate consequences of this under-specification and proposed a layer on top of method combinations designed to both correct a number of observed behavioral inconsistencies, and propose an extension called "alternative combinators".
Following this work, SBCL underwent a number of internal changes that fixed the reported inconsistencies, although in a way that hindered further experimentation.

In this paper, we analyze SBCL's new method combinations implementation and we propose an alternative design. Our solution is standard-compliant so any Lisp implementation can potentially use it. It is also based on the MOP, meaning that it is extensible, which restores the opportunity for further
experimentation. In particular, we revisit our former "alternative combinators" extension, broken after 2018, and demonstrate that provided with this new infrastructure, it can be re-implemented in a much simpler and non-intrusive way.

Files

verna.23.els.pdf

Files (253.2 kB)

Name Size Download all
md5:41428f4b21493d7fc7e4a06f178a2c2b
253.2 kB Preview Download

Additional details

Related works

Compiles
2677-3465 (ISSN)
978-2-9557474-7-6 (ISBN)