hg: lambda/lambda/jdk: Update initial lambda APIs and tests to use new syntax.

Stuart Marks stuart.marks at oracle.com
Sun Sep 11 22:12:58 PDT 2011


On 9/11/11 6:29 PM, Collin Fagan wrote:
> On Sun, Sep 11, 2011 at 12:30 PM, Bob Foster<bobfoster at gmail.com>  wrote:
>
>> Remi Forax wrote:
>>
>>> BTW I think the methods xor should be removed
>>>   for the same reason there is no ^^ in C
>>>   (nobody use xor in test between booleans)
>>
>> There is no ^^ in C because xor can't be short-circuited. You can, however,
>> use ^ to combine logical results in C. I've done it.
>>
>> Pedantry aside, you're probably right. :)
>>
>> Bob
>>
> I vote to leave xor in. I've had to write it a few times now and it's always
> frustrating when xor is overlooked.
>
> Collin

The binary xor seems useful, but I find the N-ary xor questionable. Indeed, 
this was discussed when the functions were initially pushed; see the thread

http://mail.openjdk.java.net/pipermail/lambda-dev/2011-August/003772.html

in particular the comments from Steven Simpson and David Holmes. The method's 
doc seems to describe xnor. In addition I don't think there was agreement on 
the definition of N-ary xor. Even if we did agree, I'm not sure it would 
actually be useful. :-) So, I'd vote to remove the N-ary xor() variants.

s'marks


More information about the lambda-dev mailing list