[squeak-dev] The Inbox: Kernel-fn.1151.mcz

Levente Uzonyi leves at caesar.elte.hu
Sat Feb 10 19:02:39 UTC 2018


On Sat, 10 Feb 2018, Tony Garnock-Jones wrote:

> On 02/10/2018 06:05 PM, Jakob Reschke wrote:
>> I am still wondering why one would want to use xor with a block in the
>> first place.
>
> An interpreter, perhaps:
>
>    a perform: {#or:. #xor:. #and:} atRandom with: [b]
>
> Seems like a pretty artificial example, of course :-)

Neither #or: nor #and: check the type of the argument, so adding that to 
#xor: would be a new "feature".
But both #or: and #and: accept booleans as argument.
So,

 	a perform: {#or:. #xor:. #and:} atRandom with: b

would just work for that imaginary interpreter if b were a Boolean.

Levente

>
> Tony


More information about the Squeak-dev mailing list