[m-dev.] Module qualification of typeclass methods

Peter Ross peter.ross at miscrit.be
Wed Nov 21 00:04:31 AEDT 2001


On Tue, Nov 20, 2001 at 11:02:04PM +1100, Fergus Henderson wrote:
> On 20-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > On Tue, Nov 20, 2001 at 08:28:11PM +1100, Fergus Henderson wrote:
> > > On 30-Oct-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > > > Simon wrote:
> > > > > Would it be better to add an `import_package' declaration, which
> > > > > is like `import_module', but also imports all sub-modules of the
> > > > > imported modules.
> > > >
> > > > This could be problematic when you have a very large hierachy of sub
> > > > modules.  For instance if you want to use the System namespace in .NET you
> > > > would also have to load in all the children namespaces.  This would be huge,
> > > > so maybe it is not such a great idea because it could lead to too much
> > > > importing.
> > > 
> > > I'm not sure what problem you're worried about here.
> > > Is it namespace polution, or efficiency?
> >
> > I was worried about efficiency.
> 
> If efficiency is really a significant problem,
> users can use more precise declarations than
> a single ":- use_package 'System'.", e.g. 
> 
> 	:- use_package 'System__Data'.
> 	:- use_package 'System__Reflection'.
> 
This is almost true.  However if they want to use the System namespace
then they will import every child of the System namespace as well, or
once again you would have the zillions of import problems for using
classes at the System namespace level.

However I think that this is not a problem with the use_package
mechanism but a problem with my thoughts about how to map .NET
assemblies onto the Mercury module system.

I think what we want to do is to use the assembly name as an extra
qualifier.  In other words System.Object maps to
mscorlib__System__Object and you will do a ":- import_package mscorlib"
to use the part of the System namespace that is contained in the
mscorlib assembly.  This also corresponds with how .NET does it.  You
don't import a namespace, you reference an assembly.

Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list