Created
December 23, 2021 15:56
-
-
Save mcmillhj/3ac9edc27423dfb71e4108da89274c7e to your computer and use it in GitHub Desktop.
Extra layer of nesting added after return
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 modify-copy-and-return(@a is copy, @b is copy) { | |
my @buffer; | |
@buffer.append: @a; | |
@buffer.append: @b; | |
@buffer.push: [1,2]; | |
dd @buffer; | |
# Array @buffer = [[1, 2], [3, 4], [3, 4], [5, 6], [1, 2]] | |
True, @buffer; | |
} | |
my @a = [1,2],[3,4]; | |
my @b = [3,4],[5,6]; | |
my $should-continue = False; | |
my @buffer; | |
($should-continue, @buffer) = modify-copy-and-return(@a, @b); | |
dd $should-continue; | |
dd @buffer; | |
# Array @buffer = [[[1, 2], [3, 4], [3, 4], [5, 6], [1, 2]],] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment