develooper Front page | perl.perl6.users | Postings from January 2019

Re: Bad syntax check

Thread Previous | Thread Next
From:
ToddAndMargo via perl6-users
Date:
January 2, 2019 22:27
Subject:
Re: Bad syntax check
Message ID:
d810a6f1-9dd8-bee8-e270-bf9d2642d51e@zoho.com
On 1/2/19 2:11 PM, Simon Proctor wrote:
> Have you tried defining your return values in the signature?
> 
> sub AddThree( Int $a, Int $b, Int $c --> Int) {...}
> 
> With this the compiler knows what your function is supposed to return 
> and can earn you in advance.

I did and it blew up in my face so I stopped doing it.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About