Closed ddimtirov closed 7 years ago
I tried, but I couldn't come up with a natural looking API for implementing multiple dispatch in Java that would save work and increase the readability compared to just writing a naive switch statement or a series of if (x instanceof Y) doThis(x) else ...
code.
I am giving up for the time being, but I tagged the leftovers with the nuggets-20-dead-end tag.
Multiple dispatch or multimethods is a feature of some programming languages in which a function or method can be dynamically dispatched based on the run-time (dynamic) type or, in the more general case some other attribute, of more than one of its arguments.