What is multiple dispatch?
Multiple dispatch means that a function or method is connected to more than one type. The decision which method is called at runtime is done based on more than one of its arguments. The classic object orientation is a special case where a method is connected to one class and the dispatch decision is done based on the type of the ‘self’ or ‘this’ parameter. The classic object orientation is a single dispatch system. In a multiple dispatch system the methods cannot be grouped to one class and it makes no sense to have a ‘self’ or ‘this’ parameter. All parameters are taken into account when the dispatch decision is done. In the following example the interface type ‘Number’ uses multiple dispatch: const type: Number is sub object interface; const func Number: (in Number param) + (in Number param) is DYNAMIC; The ‘DYNAMIC’ declaration creates an interface function for the ‘+’ operator. The interface type ‘Number’ can represent an ‘Integer’ or a ‘Float’: const type: Integer is new struct var