ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: [myrmidon] -ref vs ${}
Date Sun, 07 Apr 2002 10:02:20 GMT
From: "Peter Donald" <peter@apache.org>

Pete, I never got to answer your question on this matter. I have been kind of overwelmed at
work.

In any case, here I go:

> I just wanted to get peoples opinion on something I been playing with. 
> Currently in myrmidon the followin attributes will get identical values
> 
> myAttribute="${value}" 
> myAttribute-ref="value"
> 

To me it all depends on the meaning of "${value}". The way I see it "${value}" corresponds
to the
string representation of "value". I say this, because it should not matter whether I pass
"${value}"
or "${value} is a value" the ${} operator should behave the same.

With that in mind, then 'myAttribute="${value}"' implies converting 'value' into its string
representation
and then converting it back to the type specified for 'myAttribute'. You could try to optimize
away 
such conversions, but it means that you cannot pass a subtype that way because by definition
it should behave like the value is being reconstructed from its string representation into
that of the
type of the attribute.

'myAttribute-ref="value"' on the other hand should be passing a reference and as such if has
a different behaviour.


> My question is do we need to support the "-ref" version of attribute 
> evaluation or is the first sfficient for all our use cases?
> 

In sumary:

    <sometype id='value' ....../>
    <sometask myAttribute='${value}'/>

should be indistinguisable from:

    <sometype id='value' ....../>
    <property name='prop' value='${value}'/>
    <sometask myAttribute='${prop}'/>

for all types. Otherwise your type-system would not seem to be well defined and you will finish
with future extrange behaviour.

Jose Alberto




--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message