"multiple dispatch" terminology abuse #1006

Util opened this Issue Oct 5, 2013 · 1 comment


None yet

2 participants

Util commented Oct 5, 2013

Reported by: zefram@fysh.org

docs/pdds/pdd27_multiple_dispatch.pod uses the term "multiple dispatch" to refer to the mechanism whereby a call to one sub will be forwarded to one of many subs depending on the types of the arguments. In the standard terminology, this is merely "dispatch". The term "multiple dispatch" properly refers specifically to dispatching based on the types of more than one argument. Dispatching based on a single argument is "single dispatch", no matter how many different subs it can dispatch to. Note that dispatching via a vtable is inherently single dispatch.


rurban commented Feb 15, 2016

docs/pdds/pdd27_multiple_dispatch.pod describes "multiple dispatch" correctly, dispatching on the types of "all" arguments. This is what perl6 wants. However, parrot does not implement "multiple dispatch" internally, it is implemented in the nqp level of perl6 instead, with the help of parrots MultiSub PMC.

The docs mentions that:
"Parrot has a single multiple dispatch system, used at the HLL level and
internally. {{NOTE: I appreciate the history that led us to have two largely
independent MMD systems, but it will cause problems down the road, if we don't
fix it now.}}

The heart of the system is the MultiSub PMC. All multiple dispatch routines
are MultiSub PMCs, subclasses of MultiSub, or polymorphic equivalents of
MultiSub. Calls to multiple dispatch routines use the Parrot calling

For binary dispatch in certain internal arithmetic binops
parrot uses src/multidispatch.c which is also documented as such.

There's no terminology abuse, it is correctly documented.

@rurban rurban closed this Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment