Well, to me the expression language should be able to support
the same functionality as our current Conditions.

Actually, ideally, any new condition type that is added, should be
transparently made available in the expression language as a new
function. (We would have to define how the mapping happens).

The idea being that the languaje will be able to know that:

   "available('${a}', 'file')"

it will use <available name="${a}" type="file"/> to evaluate the
expression.

Part of that, could be achieved by having a new interface:

public interface Positional {
    /** The arguments for the call in positional order */
    void positionalArgs(Object args[]);
}

The implementation of this method will look at the arguments and set the
correct
attributes of the condition instance.

With this, the evaluation engine would be able to just create a new
instance of 
the type, pass the arguments, and then (for conditions) call eval() to
get the result.

Now, that would make a very powerful, integrated, evaluation language!
Of course, I should be able to get the conditions defined in antlibs
also, which
means being able to say: 
   
     "mylib:mycondition(....)"  and this will look for the condition on
the right antlib.

For the syntax of the language itself, any of the ones proposed is fine.

Jose Alberto


> -----Original Message-----
> From: Dominique Devienne [mailto:[EMAIL PROTECTED] 
> Sent: 11 May 2004 17:28
> To: 'Ant Developers List'
> Subject: RE: ANT 1.7 features suggestion
> 
> 
> > From: Alexey N. Solofnenko [mailto:[EMAIL PROTECTED]
> > 
> > Actually <if> is too wordy. A mall <target if="XXX"> is translated 
> > into
> > 
> > Complex conditions are big. A small expression language 
> like "XXX && 
> > YYY" would be much nicer.
> 
> I so agree with you! That expression language could (should 
> IMHO!) be XPath (JXpath or Jaxen are candidates, or the Xalan 
> one?) where Ant properties would be available as XPath 
> properties, and some of Ant's condition made into XPath functions.
> 
> We'd be restricted to boolean XPath expressions only, and 
> have no access to any DOM tree initially, allow I would 
> actually like to be able to navigate the DOM of the build 
> file (but that's another story).
> 
> So Ant would have an XML friendly, very well defined and 
> documented expression language. --DD
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to