> From: peter reilly [mailto:[EMAIL PROTECTED]
> 
> This won't work as the default attribute gets processed by ant before
> macrodef sees it.
> for example:
> <property name="foo" value="global foo"/>
> <macrodef name="macro">
>    <attribute name="foo"/>
>    <attribute name="bar" default="${foo}"/>
>    <sequential>
>      <echo>bar is ${bar}</echo>
>    </sequential>
> </macrodef>
> <macro foo="macro's foo"/>
> 
> generates
> foo:
> bar is global foo

And this time I think I'm right Peter when I say *this* is what I argued
vehemently against. In the fruitless argument on ant-dev we had, I pointed
out that you are overloading the meaning of ${name} in <macrodef>, which is
perfectly apparent in the above example. And this is why I wanted to
introduce a special notation for referring to the <macrodef> attributes,
implicitly making them 'local properties' as you've introduced in your
patch. ${name} would still evaluate *as usual*, dynamically changing the
actual implementation of the <macrodef> *at the point of definition*, while
(@name) (or some other notation) would have evaluated *at runtime* to the
'local property'.

I'm pretty sure I'm still missing a subtlety about <macrodef> and its
expansion of properties, and what I said above could be false, but the traps
and pitfalls hiding in <macrodef> are a recipe for too much confusion as it
stands IMHO. --DD

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

Reply via email to