For multiple dispatch, maybe you could find examples of where people working in C++, Java, etc. have had to implement the Visitor pattern. I've done it a couple of times myself, in compilers: it's common to implement an analysis or optimization pass as a tree walk over the AST, dispatching off both the type of analysis and the type of the current AST node. Not sure that's going to be the most accessible example, though. I have used multiple dispatch in FSet. One of the nicest things about having MD available is that you don't have to think about it; if you need it, you just use it. So until this moment, I hadn't really stopped to reflect on what I use it for. For one thing, FSet has a generic function convert that has over 200 methods; it takes a symbol, which specifies a target type, and a collection to convert, dispatching on the symbol (using an eql specializer) and the type of collection. But there are various other uses too; for instance, there's a bag-sum operation which also accepts a set as either argument; this is handled in the obvious way, by dispatching on both arguments. But I don't know that either of these examples is compelling enough to use in a book. You're welcome to cite FSet, though, if you like. The only thing I've done with the MOP recently has been to write a quick-and-dirty compatibility layer <https://github.com/slburson/copycat/blob/trunk/src/defs.lisp>, allowing some old Flavors-based code to be run in Common Lisp. You're welcome to cite this as well. -- Scott On Sat, Feb 28, 2026 at 2:09 PM Faré <fahree@gmail.com> wrote:
Dear Pro,
I'm currently writing a book on OOP, and after exhausting the usual stuff, I'm now at advanced topics that only Common Lisp and other Lisp dialects tackle, including Method Combinations, Multiple Dispatch and Meta-Object Protocols.
Are there good motivational examples that fit in a couple of pages? And/or are there good free software or source-available programs and libraries that are worth citing and sending my readers to, to illustrate the power and interest of those techniques?
For good uses the standard CLOS method combination and multiple dispatch, I am quite familiar with ASDF; and for the multiple dispatch at least, I can cite the extended version of my ELS 2014 paper. What other code bases, papers or articles may I cite?
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org “The reason truth is stranger than fiction is that fiction has to make sense.”