In this tutorial I will show how multi-methods are implemented in ELENA
To take part in parameter dispatching classes should be declared with dispatchable attribute.
To dispatch the parameter we have to send cast message to it:
This approach works quite good for a single parameter. For several parameters this approach works not so good. It is possible to resolve them using several nested closures. Currently general solution is not possible. But basic data types support limited two parameter dispatching:
The result will be: