Multiple dispatch
Multiple dispatch allows us to declare multiple variants of the same function or method, each working only with a certain type of arguments.
For example, if we declare two functions with the same name, but with different types of parameters, Sidef will decide automatically which function to call:
The functions are checked in the order in which they are declared:
It also works with methods:
Last updated