On Mon, 2005-03-14 at 22:38 -0500, Bob Rogers wrote:

> What if one wants the first and third arguments to be the invocants?
> Then the first syntax gives
> 
>        .sub foo @MULTI
>          .invocant Integer a
>          .param pmc b
>          .invocant String c
>          ...
> 
> But it's not as obvious how to do that for the second one, unless you
> use "pmc" as the explicit type name for "any":
> 
>        .sub foo multi(Integer, pmc, String)
>        .param pmc a
>        .param pmc b
>        .param pmc c

It's not as bad as it seems.  Because all three parameters use different
registers, the order of the parameters in the signature here doesn't
matter.  (It may matter to the multi-method dispatcher, but it doesn't
matter to the call.  I also think it shouldn't matter to the
dispatcher.)

I'm not sure of any case in practice where having a non-dispatchable
parameter between invocants makes sense with multi-methods, though.  Do
you have an example in mind?

-- c

Reply via email to