Created
November 10, 2011 06:37
-
-
Save clsn/1354278 to your computer and use it in GitHub Desktop.
Recursing bug in perl6 rakudo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $counter=0; | |
sub recur(Int $x) { | |
my $h; | |
$h="h" ~ $counter; | |
$counter++; | |
my @k=(1,6); | |
if ($x>0) { | |
recur($x-1); | |
} | |
for @k { | |
say $_ ~ " and h is $h"; | |
} | |
say "h is $h"; | |
} | |
recur(3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected output, and received from earlier perl6 (This is Rakudo Perl 6, version 2011.06 built on parrot 3.5.0 RELEASE_3_5_0):
1 and h is h3
6 and h is h3
h is h3
1 and h is h2
6 and h is h2
h is h2
1 and h is h1
6 and h is h1
h is h1
1 and h is h0
6 and h is h0
h is h0
Output received from later rakudo (This is perl6 version 2011.10-98-g1985138 built on parrot 3.9.0 revision RELEASE_3_9_0-51-g65e6ab7):
1 and h is h3
6 and h is h3
h is h3
1 and h is h3
6 and h is h3
h is h2
1 and h is h3
6 and h is h3
h is h1
1 and h is h3
6 and h is h3
h is h0