The order of evaluation for if and unless can go either way AS LONG AS it is well documented. I am not sure if the order of evaluation if discussed anywhere in the documents.
Over the years I have worked with many C derived languages where the individual clauses in a boolean expression are evaluated in the order they are written. Thus it is possible to write an expression that both checks a pointer for null and looks at the object it points at. So when I began developing NANT scripts, this is the viewpoint that I brought to the table. Based on Gert's message, I now learn that NANT is more like VB where each clause of a boolean expression is always evaluated. This will change how I code my build scripts. Personally, I would prefer that "if" and "unless" be evaluated early, but will settle for the documentation cleary telling me when they are evaluated. (Early evaluation seems more natural to me, but then I "grew up" writing C.) If the current evaluation order is kept, it would be nice to a note to the "if" and "unless" attributes telling users that they are evaluated only after all other attributes are validated. - Tony -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gary Feldman Sent: Tuesday, August 23, 2005 8:40 AM Cc: nant-users@lists.sourceforge.net Subject: Re: [Nant-users] "if" attribute on mkdir ignored Gert Driesen wrote: >----- Original Message ----- >From: <[EMAIL PROTECTED]> > > > >>... >><mkdir dir="${empty}" >>if="${string::get-length(empty) != 0}" /> ... >> >>BUILD FAILED >> >>C:\Projects\Eden4All\test.build(6,4): >>An empty string is not a valid value for attribute 'dir' of <mkdir ... >>/>. >>... >> >The value of the if/unless attribute is not evaluated before the >initialization of other attributes or child elements, hence you still >get build errors when you specify invalid values for these other attributes. > >I'm not sure if this is something we should change. > > What are the arguments in favor of not changing it? This issue comes up fairly frequently, not just for the mkdir task. That indicates that many people expect the if attribute to be evaluated before any other attribute. Shouldn't that be the rule, applicable to all tasks, with no exceptions? Gary ------------------------------------------------------- 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 _______________________________ This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ------------------------------------------------------- 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