multi return values

2008-11-21 Thread Andy Colson
Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); using: This is Rakudo Perl 6, revision 32970 built on parrot 0.8.1-devel for i486-linux-thread-multi. I get: Method

Re: multi return values

2008-11-21 Thread Carl Mäsak
Ryan (>), Moritz (>>), Andy (>>>): >> (The thing that's still wrong with your code is that you need a >> whitespace after the 'my', otherwise my(...) should be parsed as a >> function call). > > Also this, I think: > >> > return($a, $b); ...except that that _is_ a function call. // Carl

Re: multi return values

2008-11-21 Thread Ryan Richter
On Fri, Nov 21, 2008 at 08:16:21PM +0100, Moritz Lenz wrote: > Andy Colson wrote: > (The thing that's still wrong with your code is that you need a > whitespace after the 'my', otherwise my(...) should be parsed as a > function call). Also this, I think: > > return($a, $b); -ryan

Re: multi return values

2008-11-21 Thread Moritz Lenz
Andy Colson wrote: > Moritz Lenz wrote: >> Andy Colson wrote: >>> (Sorry if this dbl-posts, sent it from the wrong account the first time) >>> >>> Hi all, what's wrong with this code: >>> >>> use v6; >>> >>> sub multireturn($x, $y) >>> { >>> my $a = $x * 2; >>> my $b = $y * 2; >>> retur

Re: multi return values

2008-11-21 Thread Andy Colson
Moritz Lenz wrote: Andy Colson wrote: (Sorry if this dbl-posts, sent it from the wrong account the first time) Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); Th

Re: multi return values

2008-11-21 Thread Moritz Lenz
Andy Colson wrote: > (Sorry if this dbl-posts, sent it from the wrong account the first time) > > Hi all, what's wrong with this code: > > use v6; > > sub multireturn($x, $y) > { > my $a = $x * 2; > my $b = $y * 2; > return($a, $b); > } > > my($a, $b) = multireturn(2, 3); The

Re: multi return values

2008-11-21 Thread Jonathan Worthington
Andy Colson wrote: Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); Nothing that I can see. using: This is Rakudo Perl 6, revision 32970 built on parrot 0.8.1-devel for i486-

multi return values

2008-11-21 Thread Andy Colson
(Sorry if this dbl-posts, sent it from the wrong account the first time) Hi all, what's wrong with this code: use v6; sub multireturn($x, $y) { my $a = $x * 2; my $b = $y * 2; return($a, $b); } my($a, $b) = multireturn(2, 3); using: This is Rakudo Perl 6, revision 329