Browse files

Allow ^... form just for lue++

  • Loading branch information...
1 parent 3150289 commit 766f608bd9a043b78b1ea06c74d82c1205cef023 @TimToady TimToady committed Oct 30, 2013
Showing with 13 additions and 2 deletions.
  1. +13 −2 S03-operators.pod
View
15 S03-operators.pod
@@ -14,8 +14,8 @@ Synopsis 3: Perl 6 Operators
Created: 8 Mar 2004
- Last Modified: 29 Oct 2013
- Version: 269
+ Last Modified: 30 Oct 2013
+ Version: 270
=head1 Overview
@@ -2021,6 +2021,17 @@ Hence the sequence operator is "auto-reversing", unlike a range operator.
'z' .. 'a' # represents a null range
'z' ... 'a' # z y x ... a
+For completeness, you may omit the first value using the C<^...> form:
+
+ 'z' ^... 'a' # y x ... a
+ 5 ^... 1 # 4, 3, 2, 1
+
+But be aware that this form will almost certainly confuse your readers if the list
+on the left is complicated, especially if the left list is another sequence:
+
+ 1, 2, 3 ^... *; # 2, 3 ... !
+ 1, 2, 3 ... 10, 20, 30 ^... *; # 2, 3 ... !?!?
+
As with numeric values, a string match must be exact, or an infinite sequence
is produced. Use a different smartmatch such as a regular expression or
a closure to do fancier tests.

0 comments on commit 766f608

Please sign in to comment.