[m-dev.] Module qualification of typeclass methods

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


On 01-Nov-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> On 31-Oct-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > Fergus wrote:
> > To make this clear:
> > 
> > :- module foo__bar.
> > :- export_module baz__bar__foo.
> > :- end_module.
> > 
> > Would replace all module qualifiers baz__bar__foo with foo__bar on the items
> > in baz__bar__foo.
> > 
> > > % 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'.

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