Skip to content

Commit

Permalink
[S08] enforce correct precedence, as pointed out by pmichaud++
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@28342 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
ruoso committed Sep 21, 2009
1 parent bc0c9eb commit 92a5290
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions S08-capture.pod
Expand Up @@ -115,7 +115,7 @@ the barrier used to detect the dimensionality of the data structures
by the operators is whatever the item inside it implements Parcel or
Capture. For instance:

my $a = 1, (2, (3, 4));
my $a = (1, (2, (3, 4)));
say $a[1];

In that case, you'll get "2, (3, 4)" (or whatever is implemented in
Expand Down Expand Up @@ -165,14 +165,14 @@ really matter which sigil it uses:
Captures and Parcels are seen the same way regarding
multidimensionality, for instance:

my $a = (map { $_ * 2 }, 1..5),(map { $_ / 2 }, 1..5);
my $a = ((map { $_ * 2 }, 1..5),(map { $_ / 2 }, 1..5));
say $a[0;0]; # 2
say $a[1;0]; # 0.5

The same way, if each map closure returns more than one item inside
its capture:

my $a = (map { $_ * 2, $_ / 2 }, 1..5),(map { $_ / 2, $_ * 2 }, 1..5);
my $a = ((map { $_ * 2, $_ / 2 }, 1..5),(map { $_ / 2, $_ * 2 }, 1..5));
say $a[0;0;0]; # 2
say $a[0;0;1]; # 0.5
say $a[1;0;0]; # 0.5
Expand Down

0 comments on commit 92a5290

Please sign in to comment.