Last active
August 29, 2015 14:23
-
-
Save skids/eee195166e8ded9393c2 to your computer and use it in GitHub Desktop.
Perl6 Rule of Comma
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
< Is there a top-level comma? > | |
YES NO | |
< Are you in flattening context? > < Does the destination bind to a $ or unsigilled? > | |
YES NO YES NO | |
<protected by .item or $() ?> Stays the same Stays the same Decontainerize | |
YES NO | |
Stays the same Interpolate | |
$_ for flat 1, $[2,3]; # YES, YES, YES: 1, [2,3] | |
$_ for flat 1, [2,3]; # YES, YES, NO: 1,2,3 | |
$_ for flat [2,3],; # YES, YES, NO: 2,3 | |
$_ for flat 1, [2,3]; # YES, YES, NO: 1,2,3 | |
$_ for 1,[2,3]; # YES, NO: 1,[2,3] | |
my $a = [2,3]; # NO, YES: [2,3] | |
my \a = [2,3]; # NO, YES: [2,3] | |
$_ for flat = [2,3]; # NO, NO: 2,3 | |
# Assuming list assignment still flattens, which apparently is still TBD: | |
my @a = [2,3]; # NO, NO: 2,3 | |
my @a = [2,3],; # YES, YES, NO: 2,3 | |
my @a = 1, $[2,3]; # YES, YES, YES: 1, [2,3] | |
my @a = 1, [2,3]; # YES, YES, NO: 1,2,3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment