[m-dev.] module system discussion

Peter Ross peter.ross at miscrit.be
Mon Dec 17 22:18:59 AEDT 2001


Simon wrote:
> On 14-Dec-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > Simon wrote:
> > > On 13-Dec-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > > > I think the transparent_module name is misleading, and to use the
> > following
> > > > name would be better:
> > > >
> > > > :- namespace ns.
> > > > :- end_namespace ns.
> > >
> > > I have no objection to this. I'm not sure whether it would be worth
> > > adding an `:- import_namespace' declaration -- it would seem a bit
> > > strange to import a `namespace' using an `:- import_*module*'
declaration.
> > > But that's a minor detail.
> > >
> > Actually on further consideration, a namespace declaration should be
> > equivalent to
> >
> > :- import_module ns.
>
> That should be `:- use_module ns'.
>
I think it should be :- import_module.  I believe that you should be able to
use the name unqualified without having to do anything special in the module
which defines the namespace.  Everyone else should have to explicitly ask to
use the namespace unqualified.

> > :- transparent_module ns.
> > :- end_transparent_module ns.
> >
> > that way the parent module can use the items defined inside the
namespace
> > without having to do anything.
>
> That doesn't deal with the issue I raised. It should still be possible
> to `:- import_module' the `namespace' in order to refer to the items
> it contains without qualification.
>
You are correct.

:- using_namespace ns.

seems to be the standard in C# and C++.

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