Skip to content(if available)orjump to list(if available)

A polyglot's guide to multiple-dispatch

gobdovan

This is a nice illustration of the expression problem, which the article itself points out toward the end. Multiple dispatch is a language-level way to solve it. Crafting Interpreters [1] has a very approachable Java-based chapter that also covers these patterns in detail.

[0] https://en.wikipedia.org/wiki/Expression_problem

[1] https://craftinginterpreters.com/representing-code.html

lisper

Cue the smug Common Lisp weenies...

Oh, wait, that's me :-)

adgjlsfhk1

don't worry. the Julia peeps can also be smug about this (as one)

upghost

To your point, I assume the "polyglot" part was referring to the arguments this would spawn in the comment section