Front page | perl.perl6.compiler |
Postings from April 2005
for @x -> $_ bug
Thread Previous
|
Thread Next
From:
Aaron Sherman
Date:
April 25, 2005 10:05
Subject:
for @x -> $_ bug
Message ID:
1114448743.5104.6213.camel@pps
I'm encountering a bug in the execution of a for loop like so:
$ ./pugs x.p6
Original array: 123456
Implicit assignment to $_:
1
2
3
4
5
6
Explicit assignment to $_:
1
3
5
$ cat x.p6
my @x = (1,2,3,4,5,6);
say "Original array: ", @x;
say "Implicit assignment to \$_:";
for @x {
say $_;
}
say "Explicit assignment to \$_:";
for @x -> ($_) {
say $_;
}
Am I doing something wrong?
--
Aaron Sherman <ajs@ajs.com>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback
Thread Previous
|
Thread Next