From: "Peter Donald" <[EMAIL PROTECTED]>
> On Sun, 21 Oct 2001 20:53, Jose Alberto Fernandez wrote:
> > From: "Peter Donald" <[EMAIL PROTECTED]>
> >
> > > On Sat, 20 Oct 2001 19:36, Jose Alberto Fernandez wrote:
> > > > 3) Invocation scope: what we have called user-properties in the past.
> > > > Implemented by <param> on <ant*>. The value takes precedence from
> > > > any definitions in the project being called (just like ANT1).
> > > > Parameters in command line follow the same rules.
> > >
> > > I would call this Workspace scope.
> >
> > I really do not care about this names, but I have never heard the term
> > Workspace used for a calling stack. Can you expand on your reasons?
>
> A Workspace contains Projects. So if a property is shared between all these
> projects it is in the Workspace scope. However if you are trying to treat
> Targets as methods then it makes less sense - but that is not the type of
> interpretation we want to support anyways so no loss there.
>
This is actually what I am against, the concept of some global space that allow
things
to communicate by side effect. It produces spaggetti code and bad practices.
What I was talking about is argument passing in calls to <ant*>. They exist
today,
they are needed today, and it is in the charter of ANT2 that they should be
supported
not only for string properties, but also for datatypes. They are special
because of
the way they preclude declarations in the project file itself.
It needs to be formalized properly as it needs to cover datatypes properly.
For example, what does it mean for a DT precluding a DT declaration?
What happens if the precluded definition also defines other DTs in inner
elements?
Will those get defined? Ex.:
<fileset id="myfiles" dir="${server.src}" casesensitive="yes" >
<patternset id="non.test.sources" >
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</patternset>
</fileset>
If I use <ant> to call a project containing the above segment but pass as
parameter
my own instance of "myfiles", would "non.test.sources" be defined? or would the
definition
be precluded since the encompassing definition was precluded?
> > Well, if you look at some ot the other proposals for scoping rules, you see
> > two things floatings around: mutability and global properties. Both are
> > there as a way for people to do something in an <ant> call and obtain
> > results by global side effects. Now, if there is an actual need for being
> > able to retrieve information from subordinate build processes <returns> is
> > much more modular than global variables.
>
> Again - treating targets as methods is not and nor will ever be - recomended
> or supported behaviour.
>
>From the buildfile for ANT:
<target name="main"
description="--> creates a minimum distribution in ./dist">
<antcall inheritAll="false" target="dist-lite"/>
</target>
If this is not a method call, I do not know what else it could be.
The truth of the matter is that <ant> and <antcall> are method calls
or (procedure calls, strictly speaking).
They pass arguments (by value), they create a new environment in
the stack, they execute "code", and the environment is released at
the end. And more to the point, people use it that way.
I do not see how you plan to unsupport its ussage.
Jose Alberto