Sounds very very good. The light of the 1.6 release seems to come closer to
the horizon.

Cheers from Walldorf,

Antoine

-----Ursprüngliche Nachricht-----
Von: Peter Reilly [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 3. Dezember 2003 14:37
An: Ant Developers List; Ant Users List
Betreff: Macrodef @{x}


I have committed the changes to change from ${x} to @{x} for
macro attributes substitution.

Usage of macrodef is now as follows:
<macrodef name="example">
   <attribute name="x"/>
   <sequential>
      <echo>The attribute has the value '@{x}'</echo>
  </sequential>
</macrodef>

This can be called as follows:
<example x="a value"/>

The escape sequence @@{ may be used to escape the substitution:

<macrodef name="example">
   <attribute name="x"/>
   <sequential>
      <echo>The attribute @@{x} has the value '@{x}'</echo>
  </sequential>
</macrodef>

<example x="a value"/>

Will result in:
     [echo] The attribute @{x} has the value 'a value'

The mechanisms for substition are different for properties and
macrodef attributes so one may now do the following:

    <macrodef name="double">
      <attribute name="prop"/>
      <sequential>
        <echo>@@{prop} is '@{prop}', value of [EMAIL PROTECTED] is
'[EMAIL PROTECTED]'</echo>
      </sequential>
    </macrodef>
    <property name="property" value="A property value"/>
    <double prop="property"/>

resulting in:
     [echo] @{prop} is 'property', value of ${property} is 'A property
value'

These changes will be available for the next ant 1.6 beta build.

Peter

---------------------------------------------------------------------
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