Skip to content

Commit

Permalink
[S09] too-long subscript range behaves differently as rvalue or lvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Sep 8, 2010
1 parent 6924749 commit 7e40979
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions S09-data.pod
Expand Up @@ -13,8 +13,8 @@ Synopsis 9: Data Structures

Created: 13 Sep 2004

Last Modified: 9 Jul 2010
Version: 47
Last Modified: 7 Sep 2010
Version: 48

=head1 Overview

Expand Down Expand Up @@ -215,8 +215,10 @@ Attempting to access an index outside an array's defined range will fail:
@dwarves[7] = 'Sneaky'; # Fails with "invalid index" exception

However, it is legal for a range or series iterator to extend beyond the end
of an array as long as its min value is a valid subscript; the range
is truncated as necessary to map only valid locations.
of an array as long as its min value is a valid subscript; when used as an
rvalue, the range is truncated as necessary to map only valid locations.
(When used as an lvalue, any non-existent subscripts generate WHENCE proxies
that can receive new values and autovivify anything that needs it.)

It's also possible to explicitly specify a normal autoextending array:

Expand Down

0 comments on commit 7e40979

Please sign in to comment.