ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <JFernan...@viquity.com>
Subject RE: Ant2 and properties
Date Mon, 04 Dec 2000 23:57:13 GMT
> From: Peter Donald [mailto:donaldp@apache.org]
> 
> 
> At 12:26  4/12/00 -0800, you wrote:
> >> From: Peter Donald [mailto:donaldp@apache.org]
> >> 
> >> At 12:30  5/12/00 +1100, Conor MacNeill wrote:
> >> 
> >> I was thinking that we could still shortcut it aswell.
> >> 
> >> ie <property name="foo" value="hello" /> is equivelent to 
> >> above. However
> >> <property name="foo" value="${myfileset}" /> would actually 
> >> assign foo a
> >> FileSet object (assuming ${myfileset} evaluated to a FileSet).
> >> 
> >> 
> >> >and what it would mean for
> >> >non-string properties (equivalent to toString() method, perhaps)
> >> 
> >> yep. See my latest proposal for what I think on that .
> >> 
> >
> >The two things above are inconsistent. Either "${myfileset}"
> >is the result ot toString() method applied to the fileset, 
> >or something else. But it should not be different things depending
> >of who is using it.
> 
> It is not differnt based on who is used it but what is stored 
> in in the
> value. If an integer is stored in the property then it will 
> evaluate to an
> Integer object, if a fileset is stored in there it will evaluate to a
> fileset. toString() is only called in cases like
> 
> <property name="blah" value="${somevar} is a variable" />
> 
> In this case ${somevar} will be "demoted" to a string because it is
> contained in another string.
> 

-1 on this, eventhough I do not vote :-(. 
How do I create a string that only contains the string value
of the data-type property?

What you are proposing is that the meaning of ${} depends on the context
in which ${} is used. That to me is confusing and wrong. The meaning of
a construct should be independent of the context in which is used,
otherwise there will be no clear rules of composition of the features.

If you still want to do this kind of things, then you need to provide a
different
syntax for the construct. For example: $[somevar] for the object and
${somevar}
for the string. This is just an example, it can be whatever other resonable
syntax.

In particular, notice that today I can say:
<classpath refid="${choice}-id" />
as long as the ids I assigned to my path objects follow a pattern.

Jose Alberto

Mime
View raw message