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

Re: Bad syntax check

Thread Previous
From:
ToddAndMargo via perl6-users
Date:
January 3, 2019 01:54
Subject:
Re: Bad syntax check
Message ID:
30c9fe08-654e-da4a-5acc-19b5f043f188@zoho.com
On 1/2/19 4:00 PM, Brad Gilbert wrote:
> You can only list one type as a return type.
> 
> If there were a hypothetical Tuple type:
> 
>      sub AddThree( Int $a, Int $b, Int $c --> Tuple[Str, Int] {
>          my Int $d = $a + $b + $c;
>          return Tuple[Str,Int].new( "a+b+c=", $d );
>      }

I drew the line at creating new types

Thread Previous


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