Klaas-Jan Stol wrote:

we just removed the ".pcc_" prefix... (i know, only from some other
directives...)  :-P
anyway, the .invocant, .arg , .result  and other directives are "grouped"
together already by the .begin_call/.end_call directives. IMHO, we don't
need a prefix to indicate such a grouping.
Your explanation of .invocant (which yes, I meant by writing ".invcant") and
:invocant is very clear, and I think if explained like that in the docs,
won't result in much confusion.

Works for me.

On a side note, (and somewhat related to the remark Bob mentions in his
reply later in this thread (on Dec 25) about the need for :invocant flags
and inferring the types of paramters involved with the dispatch), specifying
both the types in a :multi() clause AND on the parameters is suboptimal;
they need to "match".
[...]
Would it be possible to write a :multi sub like this:
sub foo
  .param string y
  .param pmc a   :invocant('Integer')
  .param pmc b   :invocant('String')
..
end

and maybe it'd be useful to set a flag (without arguments) :multi on the sub
to make it more clear on first sight that the sub is a :multi.

Agreed. (It's worth noting that the problem existed before :invocant was added.) Adding :invocant, and giving it a string parameter, means we could do away with the list of types on the :multi flag (we'd still need the :multi flag). So you could write:

  .sub foo :multi
    .param string y
    .param pmc a   :invocant('Integer')
    .param pmc b   :invocant('String')
    .param pmc c
  ..
  .end

Which would generate a multi-signature for the sub roughly equivalent to "(STRING, Integer, String, _)".

Allison

Reply via email to