On May 21, 2006, at 3:46, chromatic (via RT) wrote:
The multi-dispatch signature checking code in src/mmd.c does not know
anything
about :flat calls when it constructs the signature tuple for
dispatching.
Exactly. Snippets from S06:
Multimethod and multisub invocants are specified at the start of
the
parameter list, with a colon terminating the list of invocants:
If the parameter list for a "multi" contains no colon to delimit
the
list of invocant parameters, then all positional parameters are
consid-
ered invocants.
...
Invocants are the first few *positional* arguments used for a function
call, but certainly not arguments inside some kind of flattening
container.
Imagine you have instead of ...
'foo'( args :flat )
end
.end
.sub 'foo' :multi(Integer)
... a :multi(int) / :multi(string). Due to autoboxing the native type
needed for dispatch would be lost.
Or - you have args with MAYBE_FLAT bit set and some slurpy and
non-slurpy sub variants. Would it first dispatch based on the
flattening aggregate, then again on the contents of it?
leo