[Perl5-syntax] Method signatures: are slurpy params optional by default?

Buddy Burden barefootcoder at gmail.com
Tue Apr 26 01:51:19 GMT 2011


Guys,

Does anyone know the answer to this question form the Perl6
point-of-view?  That is, given this declaration:

    method foo (@args) {}

should this call:

    $obj->foo()

throw an error?  MooseX::Method::Signatures does not, but
Method::Signatures does ("missing required parameter"), for which the
fix is simply:

    method foo (@args?) {}

If "right" were to be defined as "most conforming to currently
proposed Perl6 syntax", which one would be right?  And/or which way do
you think it _should_ be?  So far I'm leaning towards MS being
correct, but I welcome others' opinions.


            -- Buddy



More information about the Perl5-syntax mailing list