Skip to content

Commit 68fbdb7

Browse files
committed
Point out difference between finite and infinite Range subscripts
1 parent d51503b commit 68fbdb7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/Language/list.pod6

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,9 @@ list's C<.elems> as an argument and uses the resulting range to slice:
504504
say @a[0..^*/2]; # OUTPUT: «(1 2 3)␤»
505505
506506
Notice that C<0..^*> and C<0..^*+0> behave consistently in subscripts despite
507-
one being an infinite range and the other a WhateverCode producing ranges.
507+
one being an infinite range and the other a WhateverCode producing ranges,
508+
but C<0..*+0> will give you an additional trailing C<Nil> because, unlike the
509+
infinite range C<0..*>, it does not truncate.
508510
509511
=head2 Array constructor context
510512

0 commit comments

Comments
 (0)