Re: **@args question

2019-01-02 Thread ToddAndMargo via perl6-users
On 1/2/19 10:17 PM, ToddAndMargo via perl6-users wrote: > On Wed, Jan 2, 2019 at 8:41 PM ToddAndMargo via perl6-users > wrote: >> >> Hi All, >> >> Looking at >> >>  https://docs.perl6.org/routine/print >> >> I see >> >>  multi sub print(**@args --> True) >> >> Question.  If

Re: **@args question

2019-01-02 Thread ToddAndMargo via perl6-users
> On Wed, Jan 2, 2019 at 8:41 PM ToddAndMargo via perl6-users > wrote: >> >> Hi All, >> >> Looking at >> >> https://docs.perl6.org/routine/print >> >> I see >> >> multi sub print(**@args --> True) >> >> Question. If I wanted to create my own print routine >> using **@args, how would I

Re: **@args question

2019-01-02 Thread Brad Gilbert
The variable name in :(**@args) is @args, it could be any valid array identifier like @data sub printx( **@data ){…} Note that there are several forms for slurpy positional arguments. :( @a ) # not slurpy at all, takes one Positional argument and aliases it as @a. :( *@a ) # flat

**@args question

2019-01-02 Thread ToddAndMargo via perl6-users
Hi All, Looking at https://docs.perl6.org/routine/print I see multi sub print(**@args --> True) Question. If I wanted to create my own print routine using **@args, how would I declare it? sub printx( **@args data ) {...} Many thanks, -T -- ~~

Re: Bad syntax check

2019-01-02 Thread ToddAndMargo via perl6-users
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

Re: Bad syntax check

2019-01-02 Thread Brad Gilbert
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 ); } my Int $X = 0; my Int $Y = 0; my Str $Z;

Re: Bad syntax check

2019-01-02 Thread ToddAndMargo via perl6-users
On 1/2/19 2:27 PM, ToddAndMargo via perl6-users wrote: 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 yo

Re: Basic question about lexical binding in relationship with "list assignment"

2019-01-02 Thread Elizabeth Mattijsen
Fixed with https://github.com/rakudo/rakudo/commit/23663609a7 > On 27 Dec 2018, at 09:29, Raymond Dresens wrote: > > Hello, > > I'm getting up to speed with Perl 6 again after a long while, and I more > or less 'hit my nose' against something that I can reduce to the > following very basic snip

Re: Bad syntax check

2019-01-02 Thread ToddAndMargo via perl6-users
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 sto

Re: Bad syntax check

2019-01-02 Thread Simon Proctor
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. On Wed, 2 Jan 2019, 20:04 ToddAndMargo via perl6-users Dear Perl 6 Developers, > >

Bad syntax check

2019-01-02 Thread ToddAndMargo via perl6-users
Dear Perl 6 Developers, Fedora 29, x64 Xfce 4.13 $ perl6 -v This is Rakudo version 2018.11 built on MoarVM version 2018.11 implementing Perl 6.d. I am constantly improving (changing things) in my subs, etc.. As such, the things I return often change. Because of this, I have a found so

Re: Pair colon-chains

2019-01-02 Thread yary
Copied to https://github.com/perl6/roast/issues/507 -y On Tue, Dec 25, 2018 at 4:09 AM JJ Merelo wrote: > Probably not. Can you please raise an issue in perl6/doc? The first one > seems specially inconsistent... > We'll have to check also if it's REPL only or it extends somewhere else... > > El