3 ms·
One example here. CLOS-style multimethods are a reasonably good runtime analog of the way typeclasses work: typeclasses use type inference to thread a dictionar
by fiddlerwoaroof 5y ago
One example here. CLOS-style multimethods are a reasonably good runtime analog of the way typeclasses work: typeclasses use type inference to thread a dictionary of functions around, multimethods do roughly the same thing with dynamic type-checks. This means multimethods have overhead typeclasses don’t have, but it also means that multimethods don’t have the “closed-world” assumption and can be extended dynamically.