ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack J. Woehr" <>
Subject AntCallIfElse
Date Tue, 04 Sep 2001 05:05:40 GMT
Hello Ant developers --

I'm recently new to Ant but using it with great success. I've been browsing
the code and some of the documents about the Ant team's plans for Ant 2.

I'm looking at

      [DISC] procedural versus purely declarative

      * Simple flow control (if-then-else, for)

        [REJECTED - vetoes by Conor MacNeill, Glenn McAllister, Peter Donald
                    and Stefan Bodewig]

The reasons to keep Ant essentially declarative are obvious. With approval I note
that you also rejected a motion to make Ant 'purely declarative', a shibboleth
refuted already in logic programming.

There is precedent, however, for a "declarative kind of proceduralism" in other
declarative languages, for example, the m4 ifelse() macro.

It looks as if one could employ the style of coding worked out by Stefan Bodewig in
org/apache/tools/ant/taskdefs/condition to create a class CallTargetsIfElse based
on CallTarget. This would allow syntax like:

        <if target="true_target">
        <else target="false_target">

This seems a little clearer than what I do now (is this actually
correct?) :

    <target name="true_target" if="${a}">

    <target name="false_target" unless="${a}">

    <target name="switch">
            <antcall target="true_target"/>
            <antcall target="false_target"/>

Would the coding of an AntCallIfElse task be, in the light of your
prior vote cited above, a welcome or unwelcome contribution?

Thanx, Jax

Jack J. Woehr     # "I never worry that all hell will break loose.
Senior Consultant #  I worry that half hell will break loose, which
Purematrix, Inc.  #  is much harder to detect." - George Carlin

View raw message