ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: <macrodef> and local
Date Tue, 22 Jun 2004 11:21:21 GMT
> From: Jack J. Woehr [] 
> Jose Alberto Fernandez wrote:
> > The way I see it, a macrodef <let> will also solve the issue of 
> > concurrency. Notice that in all this cases the issue is how do you 
> > refer to the value just generated. Lets assume you have the macro I 
> > defined before:
> >
> > <macrodef name="example">
> >   <attribute name="foo"/>
> >   <let name="basefoo"/>
> >   <sequential>
> >     <basename property="@{basefoo}" file="@{foo}"/>
> >     <echo massage="${@{basefoo}}"/>
> >   </sequential>
> > </macrodef>
> Of course what this is really all about is the design 
> decision for rigid declarative syntax in which there is no 
> such thing as a function which returns a string into a 
> scalar. In effect, you with your local properties and I with 
> my recursive parsing are struggling to retrofit functional 
> programming into Ant without spooking the ideologues :-)

As the chief ideologue of the declarative camp that puts me in the spot

Lets not forget that real functional languages ARE declarative. 
I.e.: variable names represent a value at the point they were defined
and you cannot change that value.

What ALL proper declarative languages have that ANT does not is
the concept of local variable (functional let X; prolog's X; lisp's
lambda x) 
whose scope is just the local context in which they are mentioned.

Now that we can write recursion (the basic means of computation in any 
declarative language) we see the need for such a thing.

But it is not an easy change for ANT because the tasks that manipulate
properties assume they are global. My attempt was to comply with their
assumption and provide them with a global name for them to use.

It is probably not the best solution, but I really fear about the impack
of some of the other proposals on the assumptions that ours and third
party tasks make of how things work.

My macrodef.let tries to provide a syntax for such a local variable

Jose Alberto

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message