[m-dev.] Module qualification of typeclass methods

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 1 22:19:45 AEDT 2001


On 01-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> Fergus wrote:
> 
> > > > > % combining two modules into a single module:
> > > > > :- module foo.
> > > > > :- interface.
> > > > > :- export_module bar.
> > > > > :- export_module baz.
> > > > > :- end_module foo.
> > >
> > > How would this handle the case where `bar' and `baz' define
> > > a predicate, type, mode, etc. with the same name?
> >
> > That would be allowed, but attempts to refer to such
> > a predicate, type, or mode `x' via the name `foo__x'
> > might result in ambiguity errors.  These ambiguities
> > could be resolved by referring to it via the name `bar__x'
> > or `baz__x'.
>
> To use these names do you then have to import the bar and baz modules?

Yes.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  | "... it seems to me that 15 years of
The University of Melbourne         | email is plenty for one lifetime."
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- Prof. Donald E. Knuth
--------------------------------------------------------------------------
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