ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <>
Subject Re: Scope of Types
Date Fri, 01 Jun 2001 12:23:26 GMT
I support what Peter called Flat (although I would have called it
hierarchical :-). I can access a type defined in a project which I have
"imported" with a projectref (hmm, shame I can't stop overloading the
meaning of import :-).

So if I have

   <projectref location="..." name="blah">

I should be able to define a value of a type from that project


of if blah itself imports another project as fubar, we could access it's
types as


(the ":" separator, could be changed - not important for this discussion)

So, basically hierarchical in nature. I can then pass these values into an
antcall to the imported project where it can understand that value. It does
not make much sense to me for me to pass my own types into the imported
projects via an antcall because I can't see how it can understand the type
in any way.

> I'm not sure that we can separate the discussion of type scope from
> the discussion of instance scope - at least not completely.  If we
> allow an instance of a type to cross build file boundaries, the type
> itself obviously must do so as well.

Well, I think the instance can cross the boundary but on the otherside it
won't be very useful, perhaps only toString'ing it. It is a bit like
passing an instance of a type I have defined into a JDK method. It is only
going to be able to treat as an object (although reflection does allow it
to do some interesting things).

> > Hierarchial can introduce far too many ambiguities in a project file
> > resolved according to a context.
> Agreed.
> Global scope has the disadvantage that you could run into name
> conflicts.

If we have <projectref> I can't see that global is workable for this

> What if you'd allow to import types from a nested namespace into the
> default namespace? Something that is what you call flat with a little
> bit of global added to it?

Yes, that would be possible, really just creating a local alias - still not
really global.

Anyway, some further thought is required on this in relation to <antcall>


View raw message