The visitor pattern is relevant in multiple dispatch also; just most of its boilerplate goes away, so that only the visitation remains: traverse the AST (or whatever structure) and invoke the given method with the node and visitor as arguments.
For list in Common Lisp, the ancient mapcar function can do this:
For list in Common Lisp, the ancient mapcar function can do this:
We still have to write method specializations the different combinations of node and visitor types we need, for the generic function visit. It's just less fragmented than the single dispatch version, because we don't have to perform two single dispatches to obtain one.