Damian Conway wrote:
> Ken wrote:
>    > The one thing I'm curious about is whether different syntactic
>    > conventions affect the dispatcher or whether this is all just
>    > sugar for a single dispatch.
> 
> Multiple dispatch is certainly not (practically) implementable via single
> dispatch.

Oops. I meant "sugar for one implementation of dispatch."

We could eliminate single dispatch and *only* use multi-dispatch.
The ":multi" attribute would just turn off the default behavior of
replacing an existing function.

> The only internal difference is that the first version has to do the
> normal Perl single dispatch look-up before it discovers that

Right. What if there wasn't a single dispatcher?

I think multi dispatch could eliminate single dispatch if we looked
for function matches in the current lexical scope *and* in the @ISA
packages for every argument.

Multi-dispatch is just as fast as single dispatch if only a single
function matches. The compiler could easily keep track of this.

- Ken

Reply via email to