Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 41950 invoked from network); 25 Jan 2005 21:28:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jan 2005 21:28:47 -0000 Received: (qmail 92084 invoked by uid 500); 25 Jan 2005 21:28:44 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 92016 invoked by uid 500); 25 Jan 2005 21:28:44 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 92001 invoked by uid 99); 25 Jan 2005 21:28:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from palrel10.hp.com (HELO palrel10.hp.com) (156.153.255.245) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 25 Jan 2005 13:28:42 -0800 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by palrel10.hp.com (Postfix) with ESMTP id A37E01D40 for ; Tue, 25 Jan 2005 13:28:40 -0800 (PST) Received: from [15.196.4.136] (bbnnaid136.bbn.hp.com [15.196.4.136]) by hplms2.hpl.hp.com (8.13.1/8.13.1/HPL-PA Hub) with SMTP id j0PLSa7e001535 for ; Tue, 25 Jan 2005 13:28:38 -0800 (PST) Message-ID: <41F6BA03.1010101@apache.org> Date: Tue, 25 Jan 2005 21:28:35 +0000 From: Steve Loughran User-Agent: Mozilla Thunderbird 1.0RC1 (Windows/20041201) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Developers List Subject: Re: cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs/condition XorTest.java References: <20050124200436.99202.qmail@web30904.mail.mud.yahoo.com> In-Reply-To: <20050124200436.99202.qmail@web30904.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Matt Benson wrote: > --- Dominique Devienne wrote: > [SNIP] > >>I find the >2 conditions case weird. Is that usual >>to extend > > [SNIP] > >>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 > > > DD, I would have thought so too, but I googled for > "xor" and the first hit was: > > http://mathworld.wolfram.com/XOR.html > > Which says, among other things: > > (quote) > For multiple arguments, XOR is defined to be true if > an odd number of its arguments are true, and false > otherwise. This definition is quite common in computer > science, where XOR is usually thought of as addition > modulo 2. In this context, it arises in polynomial > algebra modulo 2, arithmetic circuits with a full > adder, and in parity generating or checking. While > this means that the multiargument "XOR" can no longer > be thought of as "the exclusive OR" operation, this > form is rarely used in mathematical logic and so does > not cause very much confusion. > (end quote) > > I guess we learned something today. ;) > > -Matt Consider yourselves enlightened :) I didn't know about the formal definition either, it was just the and tasks worked on >2 elements, so I added the same code to the xor thing by chaining the (associative) operation. The outcome of the chain (true for an odd number of true inputs) is what you get when you start off with an initial value (false) that works for the first two inputs. -steve --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org