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
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
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
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
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
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
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-
(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