ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: xor condition
Date Sun, 17 Jul 2011 03:45:39 GMT
On Sat, Jul 16, 2011 at 10:21 PM, Stefan Bodewig <bodewig@apache.org> wrote:
> On 2011-07-17, Matt Benson wrote:
>
>> Currently each nested condition is xor'd against the cumulative result, thus:
>
>> xor(true, false) == true
>> xor(true, false, true) == false
>> xor(true, false, true, false) == false
>
>> Is this correct?  It would seem that semantically an xor over multiple
>> nested conditions should mean that exactly one value should evaluate
>> true in order for the xor operation to yield truth.
>
> While my gut feeling agrees with what you describe the documentation of
> the xor description actually says
>
> ,----
> | It only evaluates to true if an odd number of nested conditions are true.
> `----
>

So is this an accepted "kind of xor"?

> If you need the "other kind of xor" then a new container would be
> required.  "exactlyOneOf" or something similar?

I don't need it, personally, yet.  Was working in Commons Lang,
noticed the discrepancy between oacl.BooleanUtils.xor() and Ant's xor
condition, and wanted to follow up.

br,
Matt

>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message