<masak> the "signatures, multi and named arguments" email on p6u, is
that a case of the querent forgetting to ! their nameds?
<jnthn> masak: Sounds like; named args serve as a tie-break but you
actually have to demand them be present in methods for that to help,
given methods accept all named args.
* masak sends that as a reply to p6u

Brief example, which you can probably translate to your BUILD case:

$ perl6 -e 'class C { multi method x(:$foo) { say "foo" }; multi
method x(:$bar) { say "bar" } }; C.new.x(:bar)'
foo

$ perl6 -e 'class C { multi method x(:$foo!) { say "foo" }; multi
method x(:$bar!) { say "bar" } }; C.new.x(:bar)'
bar

For more on this, see
<http://design.perl6.org/S06.html#Named_parameters> and
<http://design.perl6.org/S12.html#Interface_Consistency>.

// Carl

On Sat, Sep 26, 2015 at 5:13 PM, mt1957 <mt1...@gmail.com> wrote:
> I was wondering if the long name of sub/method/submethod also includes the
> named arguments to differentiate between multi's. I had problems using multi
> on  BUILD submethods which only accept named arguments. The dispather (also
> with other named methods) always takes the first method of the multi's and
> doesn't choose the proper one looking at the named arguments.
>
> Is this behavior correct?
>
> For the moment I can get by using callsame after doing tests on the
> arguments.
>
> perl6 version 2015.09-95-g3970634 built on MoarVM version
> 2015.09-35-gd15a446
>
> Greetings
> Marcel Timmerman
>

Reply via email to