[squeak-dev] Re: [bug] xor: is this an old bug or what?

Andreas Raab andreas.raab at gmx.de
Tue Mar 24 01:22:42 UTC 2009


Keith Hodges wrote:
> true xor: [ true ]  => true

I don't think it's a bug. Unless you want to sprinkle lots of code with 
type tests, the result is whatever the implementation says, in this case:

xor: aBoolean
	"Exclusive OR. Answer true if the receiver is not equivalent to aBoolean."

	^(self == aBoolean) not

You could equally complain about

	true & "anything"

answering the argument instead of raising an error.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list