On 11/23/05, Rob Kinyon <[EMAIL PROTECTED]> wrote:
> On 11/22/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> >
> >     for ^5 { say }  # 0, 1, 2, 3, 4
>
> I read this and I'm trying to figure out why P6 needs a unary operator
> for something that is an additional character written the more legible
> way.

Huh?  Are you saying that 0..^5 is one more character than ^5?

In any case, I'm not sure that this unary helps readability, or that I
like it all that much, but I can say that it's damned useful.  I use
ranges of the form 0..$n-1 more than any other range, by a very long
shot.

> To me, ^ indicates XOR, so unary ^ should really be the bit-flip
> of the operand.

Except in Perl 6, XOR is spelled +^ or ~^, and ^ is Junctive one(). 
So it seems that ^$x should be one($x).  But that's an entirely
useless, trivial junction, so it makes sense to steal the syntax for
something else.

Luke

Reply via email to