Luke~ On 11/23/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > 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.
I think using C< ..5 > to mean (0, 1, 2, 3, 4) would be a more sensible option. Makes sense to me at least. Matt -- "Computer Science is merely the post-Turing Decline of Formal Systems Theory." -Stan Kelly-Bootle, The Devil's DP Dictionary