----- Original Message -----
From: "Peter Donald" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, January 06, 2001 3:30 AM
Subject: Re: [PROPOSAL] Enhancement to available task
> At 07:32 5/1/01 -0000, Rob Oxspring wrote:
> >I may be being daft, but I can't see how this could easily build up
"or"s -
> >assuming that these things are "and"ed together -
> >however if the available task also took a "operation" attribute, the task
> >could combine the conditions appropriately... Example steeling from Ceki
> >Gulcu's "Conditional compilation" request:
> >
> ><available property="case1" operation="and">
> > <if ...test for JNDI... />
> > <if ...test for JMS... />
> ></available>
> >
> ><available property="case2" operation="or">
> > <if ...test for JAXP from Sun... />
> > <if ...test for Xerces... />
> ></available>
>
> Sorry I am ex-philosophy major so I guess I forgot to explain how it
> happens ;) Namely like
>
> <available property="case1">
> <unless ...test for A... />
> <unless ...test for B... />
> </available>
>
> <available property="case2">
> <unless property="case1" />
> </available>
>
> ie the equivelent of
> ~(~A & ~B) == A v B
> or
> !(!A && !B) == A || B
>
Doh! That was definitely Com101 stuff! All the same though, I would of
thought having the "operation" attribute would still be low cost and easier
to use for those that don't know / can't remember much boolean logic - After
all, performing an "exclusive or" becomes very convoluted:
<available property="AxorB" operation="xor">
<if property="A"/>
<if property="B"/>
</available>
As opposed to the current proposal:
<available property="AandB">
<if property="A">
<if property="B">
</available>
<available property="AnandB">
<unless property="AandB">
</available>
<available property="~Aand~B">
<unless property="A">
<unless property="B">
</available>
<available property="AorB">
<unless property="~Aand~B">
</available>
<available property="AxorB">
<if property="AnandB">
<if property="AorB">
</available>
It is possible that nobody will want to use an xor operation but, if someone
needs to, they have their work cut out. Alternatively you could use nested
boolean operations such as:
<available property="AxorB">
<and>
<not>
<and>
<if property="A"/>
<if property="B"/>
</and>
</not>
<or>
<if property="A"/>
<if property="B"/>
</or>
</and>
</available>
I'm not convinced by this - it's a bit too general purpose for my liking,
however it's probably a bit more usable than forcing the use of only "and"s
and "not"s AND naming all the intermediates.
Just a few thoughts,
Rob
>
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof." |
> | - John Kenneth Galbraith |
> *-----------------------------------------------------*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com