Skip to content

Commit 3fbe6f7

Browse files
committed
subscript mapping now [4,:map(*%4)], sorear++
1 parent 637b6b4 commit 3fbe6f7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

S09-data.pod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Synopsis 9: Data Structures
1313

1414
Created: 13 Sep 2004
1515

16-
Last Modified: 4 Jan 2011
17-
Version: 50
16+
Last Modified: 5 Mar 2012
17+
Version: 51
1818

1919
=head1 Overview
2020

@@ -250,11 +250,12 @@ because they all end up meaning the same thing.
250250
There is no autotruncation on the left end. It's not that
251251
hard to write C<0>, and standard indexes always start there.
252252

253-
As a special form, subscript declarations may add a C<:map> modifier
253+
Subscript size declarations may add a named C<:map> argument
254254
supplying a closure, indicating that all index values are to be mapped
255255
through that closure. For example, a subscript may be declared as cyclical:
256256

257-
my @seasons[4:map(*%4)];
257+
my @seasons[4, :map( * % 4 )];
258+
my @seasons[4, :map{ $_ % 4 }]; # same thing
258259

259260
In this case, all numeric values are taken modulo 4, and no range truncation can
260261
ever happen. If you say

0 commit comments

Comments
 (0)