ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <DDevie...@lgc.com>
Subject RE: cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs/condition XorTest.java
Date Mon, 24 Jan 2005 19:41:26 GMT
> -----Original Message-----
> From: stevel@apache.org [mailto:stevel@apache.org]
>   Log:
>   Xor. Not strictly necessary,
>   but the logical equivalent is a dog to type.
> 
>   +<h4>xor</h4>
>   +<p>The <code>&lt;xor&gt;</code> element performs an exclusive
>   +or on all nested elements, similar to the <code>^</code> operator
>   +in Java. It only evaluates to true if an odd number of nested
>   + conditions are true. 

>   <!--
>     Xor semantics
> 
>     in  out
>     ==  ===
>     00   0
>     01   1
>     10   1
>     00   0
>   -->

Hi Steve. The <xor> condition sounds great, and the semantic you
put above for 2 conditions is fine by me, but I'm more confused
by the textual description when <xor> is used for more than 2
nested conditions, where the behavior is to return true for an
odd number of conditions.

I find the >2 conditions case weird. Is that usual to extend
<xor> this way? I would personally have imagined the extended
semantic to be similar to a <once> condition, i.e. it returned
true only if a single nested condition evaluated to true (which
would then allow to short circuit as soon as true count reaches
2).

Am I the only one who thinks that way? I guess I've never run
across an XOR conditional with more than 2 operands... --DD

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


Mime
View raw message