Author: ruoso Date: 2009-09-21 21:58:46 +0200 (Mon, 21 Sep 2009) New Revision: 28341
Modified: docs/Perl6/Spec/S08-capture.pod Log: [S08] enforce correct precedence, as pointed out by pmichaud++ Modified: docs/Perl6/Spec/S08-capture.pod =================================================================== --- docs/Perl6/Spec/S08-capture.pod 2009-09-21 19:21:37 UTC (rev 28340) +++ docs/Perl6/Spec/S08-capture.pod 2009-09-21 19:58:46 UTC (rev 28341) @@ -89,7 +89,7 @@ regular use of inline declarations consistent, let's say you do the following: - my $a = 0, :a<b>, 2; + my $a = (0, :a<b>, 2); say $a[2]; If we had Capture and Parcel as the same data structure, you wouldn't @@ -158,7 +158,7 @@ On the other hand, if you bind a parcel to a variable, it doesn't really matter which sigil it uses: - my @a := 1, (2, (3, 4)); + my @a := (1, (2, (3, 4))); say @a[1;1;1]; # "4" say @a[3]; # failure @@ -212,11 +212,11 @@ In order to use the context deferral in your code, you need to use the "capture sigil", which can be presented in two forms: - my ¢a = 1, (2, (3, 4)); + my ¢a = (1, (2, (3, 4))); or - my @%a = 1, (2, (3, 4)); + my @%a = (1, (2, (3, 4))); The latter is provided as an alternative for situations where you want to preserve the code in 7-bits only.