hg: lambda/lambda/jdk: Update initial lambda APIs and tests to use new syntax
David Holmes
David.Holmes at oracle.com
Mon Sep 12 23:39:05 PDT 2011
On 13/09/2011 4:22 AM, Bob Foster wrote:
> On Sun, 11 Sep 2011 22:12:58 -0700 Stuart Marks wrote:
>
>> 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.
>
> I recall that peculiar thread. :) As Steven Simpson said then:
>
>> I would expect N-ary XOR to yield true if the number of true
>> operands is odd, with no possibility of short-circuiting the result
>
> This is not just Steven's opinion, it's the definition of xor. Adding more
> operands - A ^ B ^ C ^ ... - doesn't change the definition. Should fix the
> n-ary case as above, change its name or remove it.
I'd vote for removal. While N-ary XOR seems to have adopted a definition
based on associative composition ( A ^ B ^ C = A ^ (B^C) ) this lacks any
intuitive interpretation based on "exclusivity": A^B means one or the other
may be true but not both. Whereas A^B^C allows all three to be true at once.
David
> Bob
>
More information about the lambda-dev
mailing list