develooper Front page | perl.perl6.language | Postings from September 2009

Re: r28233 - docs/Perl6/Spec

Thread Previous | Thread Next
From:
Darren Duncan
Date:
September 13, 2009 12:35
Subject:
Re: r28233 - docs/Perl6/Spec
Message ID:
4AAD4984.8020703@darrenduncan.net
pugs-commits@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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About