multidispatch
Multidispatch, or multiple dispatch, is a method dispatch mechanism in which the function that executes is chosen based on the runtime types of multiple arguments, not just a single receiver. The central idea is that the behavior of an operation can depend on the combination of types involved in a call, enabling more natural and extensible code for operations on heterogeneous data.
In a multispatch system, functions are organized as generic functions or multimethods. For a given call, the
Languages and systems that support or popularize multispatch include the Common Lisp Object System (CLOS), which
Advantages of multidispatch include easier extension (new methods can be added without modifying existing code) and