develooper Front page | perl.perl6.language | Postings from November 2008

multi return values

Thread Previous | Thread Next
From:
Andy Colson
Date:
November 21, 2008 11:11
Subject:
multi return values
Message ID:
492707E6.1010507@squeakycode.net
(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 32970 built on parrot 0.8.1-devel
for i486-linux-thread-multi.

I get:
Method 'lvalue' not found for invocant of class 'PAST;Stmts'
current instr.: 'parrot;PAST;Compiler;as_post' pc 2924
(src/PAST/Compiler.pir:742)
called from Sub 'parrot;PAST;Compiler;post_children' pc 1783
(src/PAST/Compiler.pir:368)
called from Sub 'parrot;PAST;Compiler;as_post' pc 2060
(src/PAST/Compiler.pir:500)
called from Sub 'parrot;PAST;Compiler;post_children' pc 1783
(src/PAST/Compiler.pir:368)
called from Sub 'parrot;PAST;Compiler;pirop' pc 3061
(src/PAST/Compiler.pir:796)
called from Sub 'parrot;PAST;Compiler;post_children' pc 1783
(src/PAST/Compiler.pir:368)
called from Sub 'parrot;PAST;Compiler;as_post' pc 2408
(src/PAST/Compiler.pir:614)
called from Sub 'parrot;PCT;HLLCompiler;compile' pc 434
(src/PCT/HLLCompiler.pir:303)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 868
(src/PCT/HLLCompiler.pir:502)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1233
(src/PCT/HLLCompiler.pir:676)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1412
(src/PCT/HLLCompiler.pir:765)
called from Sub 'parrot;Perl6;Compiler;main' pc 16160 (perl6.pir:168)




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