in reply to Re: Re: Re: Implication operator
in thread Implication operator

Using a bitwise xor operator as a logical xor operator can be dangerous.
sub true { return 1; } sub True { return 2; } if (true() xor True()) { print "xor is true.\n"; } if (true() ^ True()) { print "^ is true.\n"; } __END__ ^ is true.
The obvious choice for a high-precedence logical xor is ^^. It's consistent with && and ||, and it doesn't conflict with anything already in the language.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Implication operator
by Fastolfe (Vicar) on Dec 11, 2000 at 23:56 UTC
    True enough! For some reason I was thinking along the lines of comparisons, and in my head I placed &&, || and ^ in the same boat, when it really needs to be && and || in one boat and ^, | and & in another. I agree that something like ^^ might be nice.