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

Matt S Trout dbix-class at trout.me.uk
Tue Apr 26 17:26:38 GMT 2011


On 26/04/11 01:51, Buddy Burden wrote:
> 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")

I'd suggest checking what Method::Signatures::Simple does as well.

Method::Signatures basically became "schwern's experiments in signature 
syntax", which is going to produce some interesting results over time 
but means it generally isn't consistent with anything else.

In contrast, Method::Signatures::Simple and MooseX::Method::Signatures 
try and agree on their common subset - so I'd check that they both 
behave the same and if so, consider that behaviour correct. If they 
don't both behave the same, please shout and we'll work out which one to 
fix.



More information about the Perl5-syntax mailing list