On Fri, Sep 4, 2009 at 6:25 AM, <jan.mate...@rzf.fin-nrw.de> wrote:
>>I suggest to add another core PropertyEvaluator that works like the one
>>for toString but doesn't invoke toString() on the reference (but leaves
>>that to IntrospectionHelper if necessary).
>>
>>The ${ref:} and ${refid:} ideas look prettier but are more likely to
>>collide with existing property names.
>
> Because you referencing an id I would prefer ${refid:*}.

Tasks in the past had to explicitly support this by adding a separate
attribute which typically (by convention) uses a "ref" suffix (classpath="...",
classpathref="..."), so having the following two notations
(classpathref="my_cp", classpath="${ref:my_cp}" equivalent leans
towards using ref:.

OTOH, for addFoo() (i.e. nested elements), we use <classpath refid="my_cp"/>,
so that points towards refid:.

Either way is fine with me. classpath="${refid:my_cp}" reads well.

> There can be collisions as this is possible
>  <project>
>    <property name="x:foo" value="bar"/>
>    <echoproperties prefix="x"/>
>  </project>
>
>  [echoproperties] x\:foo=bar
>
> but I think the ':' as seperation character is not a common use case.
> But in conclusion that would be a note in the "could break existing
> builds" section.

We could avoid ambiguity by not using a ${} notation...

I'm not sure I like the fact that ${} would start returning something
else than a String. Then there's classpath="foo${refid:my_cp}bar"...
When you mix literals and a reference, what happens?

I've always considered that expanding references should be
something part of the core, especially when writing all those
xyzref attributes in my own tasks.

Since references are introduced by using an id="abc" attribute,
and that such attributes in HTML are fragment which are accessed
using #abc in URLs, I'd prefer we introduce this notation to expand
references, rather than overloading ${}. #abc or #{abc}, the latter
being more consistent with our existing ${} and @{} notations.

BTW, we already have ${} and @{} which interact in interesting ways,
allowing to do ${...@{bar}} inside a macro. How would #{} (or ${refid:})
interact here?

Sorry to raise concerns again... I'm just trying to see whether
reference expansion shouldn't be something built-in rather than
tacked on via PropertyHelper. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to