Multiple Dispatch

Lex Spoon lex at cc.gatech.edu
Sun Jun 15 11:10:21 UTC 2003


Joel Shellman <joel at ikestrel.com> wrote:
> I'm familiar with double dispatch, I was asking about multiple dispatch (of
> which double dispatch is a subset), so I'll take that as a no.

Incidentally, guys, hand-coded double-dispatch is nothing like
multi-dispatch supported in the language, where you can say things like:

	<Integer> + aNumber <Integer>
		"code for adding an integer"


	<Integer> + aNumber <Number>
		"default code for adding any number"



I'm surprised if no one has hacked something together to do this....

Incidentally, it would be really nice if the things in <> didn't have to
be classes, but could be some sort of interface, e.g. if it could be a
trait from Nathanael Schaerli's work.



Lex



More information about the Squeak-dev mailing list