[m-dev.] Module qualification of typeclass methods

Simon Taylor stayl at cs.mu.OZ.AU
Wed Nov 21 00:58:25 AEDT 2001


On 20-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> 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?
> 
> If we're going to have `import_package', then we should also have
> `use_package', which would be to `use_module' what `import_package'
> is to `import_module'.

Fine.

> For cases where there is a very large hierarchy
> of sub-modules, you could use `use_package'.  That would avoid the
> namespace pollution problem.

Now you've lost the ability to refer to partially qualified or
unqualified names. As I pointed out in my earlier mail, this
will often happen for the .NET libraries.

Because of the namespace pollution problem,
I'm mildly opposed to `import_package'.

Fergus, it would help if you could explain what's wrong
with `:- auto_import'.

Simon.
--------------------------------------------------------------------------
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