Author: larry
Date: Fri Apr 13 16:23:17 2007
New Revision: 14373
Modified:
doc/trunk/design/syn/S03.pod
Log:
Ranges over enums and such also can use *, suggested by Jonathan Lang++
Modified: doc/trunk/design/syn/S03.pod
==============================================================================
--- doc/trunk/design/syn/S03.pod (original)
+++ doc/trunk/design/syn/S03.pod Fri Apr 13 16:23:17 2007
@@ -14,7 +14,7 @@
Date: 8 Mar 2004
Last Modified: 13 Apr 2007
Number: 3
- Version: 111
+ Version: 112
=head1 Overview
@@ -749,7 +749,7 @@
These operators compare their operands using numeric, string,
or C<eqv> semantics respectively, and depending on the order return
one of C<Order::Increase>, C<Order::Same>, or C<Order::Decrease>
-(which numerify to -1, 0, or +1). See L</Comparion semantics>.
+(which numerify to -1, 0, or +1). See L</Comparison semantics>.
=item *
@@ -2104,18 +2104,20 @@
2.1 ~~ 1..2 # false, equivalent to 1 <= 2.1 <= 2
If a C<*> (see the "Whatever" type in S02) occurs on the right side
-of a range, it is taken to mean "positive infinity" in whatever space
-the range is operating. A C<*> on the left means "negative infinity"
-for types that support negative values. (The sign of those infinities
-reverses for a negative step.) If the C<*> occurs on one side but
-not the other, the type is inferred from the other argument. A star
-on both sides will match any value that supports the C<Ordered> role.
+of a range, it is taken to mean "positive infinity" in whatever
+typespace the range is operating, as inferred from the left operand.
+A C<*> on the left means "negative infinity" for types that support
+negative values, and the first value in the typespace otherwise as
+inferred from the right operand. (For signed infinities the signs
+reverse for a negative step.) A star on both sides prevents any type
+from being inferred other than the C<Ordered> role.
0..* # 0 .. +Inf
'a'..* # 'a' .. 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzz...'
*..0 # -Inf .. 0
*..* # "-Inf .. +Inf", really Ordered
1.2.3..* # Any version higher than 1.2.3.
+ May..* # May through December
Note: infinite lists are constructed lazily. And even though C<*..*>
can't be constructed at all, it's still useful as a selector object.