Re: r28233 - docs/Perl6/Spec

2009-09-13 Thread Darren Duncan

Darren Duncan wrote:
I think that it would be better to pick the other meaning of C<^4> 
instead, meaning C<0..3>, because that keeps the meaning of "^" 
consistent as "up to but not including".  Then also saying ^4 means you 
get a range of 4 elements, so there is that consistency too.


Also, the code example still reflects the 0..3 meaning that I prefer, so 
it is an error if the meaning you picked is chosen.


Sorry, I take back what I said.  I mis-read the comment as proposing ^4 means 
0..4 where it actually said 0..^4.  Please disregard my comment. -- Darren Duncan




Re: r28233 - docs/Perl6/Spec

2009-09-13 Thread Darren Duncan

pugs-comm...@feather.perl6.nl wrote:

Author: moritz
Date: 2009-09-13 19:42:10 +0200 (Sun, 13 Sep 2009)
New Revision: 28233

Modified:
   docs/Perl6/Spec/S03-operators.pod
Log:
[S03] ^4 cannot mean 0..3 and 0..^4 at the same time, because they are not the 
same
 
 The unary C<^> operator generates a range from C<0> up to

-one less than its argument.  So C<^4> is short for C<0..^4> or C<0..3>.
+its argument, exclusively.  So C<^4> is short for C<0..^4>.
 
 for ^4 { say $_ } # 0, 1, 2, 3


I think that it would be better to pick the other meaning of C<^4> instead, 
meaning C<0..3>, because that keeps the meaning of "^" consistent as "up to but 
not including".  Then also saying ^4 means you get a range of 4 elements, so 
there is that consistency too.


Also, the code example still reflects the 0..3 meaning that I prefer, so it is 
an error if the meaning you picked is chosen.


-- Darren Duncan