Created
August 27, 2015 19:50
-
-
Save colomon/14fab50530ef7011b316 to your computer and use it in GitHub Desktop.
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
So... if you run the very-broken script, everything works properly, both running the version of | |
very-broken-combinations from core and the indentical but for name copy very-broken-combinations-local | |
here. If you run very-broken-combinations from the REPL, it will fail: | |
> very-broken-combinations(3,2) | |
([9 10] [9 10] [9 10] [9 10] [9 10]) | |
The original combinations bug also occurred when running combinations.t, which is how I discovered it. | |
I haven't tried setting up a test file for very-broken-combinations. |
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
sub very-broken-combinations-local($n, $k) { | |
my @result; | |
my $value = 1; | |
gather for 0..4 { | |
for 0..1 { | |
@result[$_] = $value++; | |
} | |
take @result; | |
} | |
} | |
say very-broken-combinations(3,2); | |
say very-broken-combinations-local(3,2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment