Gary,

>>> What are the arguments in favor of not changing it?

I can't think of any language that does not evaluate all arguments to a 
subroutine call because invoking that subroutine.  NAnt is using XML elements 
much like subroutine calls where all attributes are evaluated before the 
element processor is called.  It's a fairly universal convention that shouldn't 
be casually tossed aside.

What people are expecting here is that the if-attribute of various NAnt 
elements is really a shorthand notation for an if-element wrapper around the 
statement.  Trying to mandate that usage would be a real kludge.

If you want to conditionalize single statements, then we need a new if task, or 
at least a new attribute on the existing if task.  The main attribute of the 
current if task if "test".  The elements enclosed by the <if>...</if> are 
assumed to be conditionalized by that test attribute.

We could add a new "stmt" attribute whose string value is an entire XML element 
whose whole execution is to be conditionalized on "test" attribute.  For 
example,

     <if test="..." stmt="<mkdir ... />" />

In this example, the <mkdir> statement would be parsed and executed ONLY if the 
test attribute were true.  This notation would, of course, be only a shorthand 
for the more verbose

     <if test="...">
          <mkdir ... />
     </if>

Merrill




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to