[Perl5-syntax] signature syntax for method return values
Michael G Schwern
schwern at pobox.com
Wed Feb 25 21:59:35 GMT 2009
Florian Ragwitz wrote:
> I wanted to add return value type constraints to
> MooseX::Method::Signatures for a while now, but I have no idea what the
> signature syntax for that should look like.
>
> Any ideas?
>
> I was thinking something like
>
> method foo (Str $a, Int $b $some_seperator HashRef) { ... }
>
> or
>
> method foo (Str $a, Int $b) $some_seperator HashRef { ... }
>
> where $some_seperator might be something like '-->', '->', '→' or
> 'Returns'.
My strongest feeling is that the return value should *not* be inside the
argument parens. They should be clearly separated. So the latter.
I also like "returns", no need to capitalize it, rather than Yet Another
Mysterious Operator. It's dead obvious what it's going to do.
--
7. Not allowed to add "In accordance with the prophesy" to the end of
answers I give to a question an officer asks me.
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/
More information about the Perl5-syntax
mailing list