[m-dev.] Module qualification of typeclass methods
Peter Ross
peter.ross at miscrit.be
Thu Nov 1 22:01:16 AEDT 2001
Fergus wrote:
> 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'.
>
To use these names do you then have to import the bar and baz modules? I
assume so, but I am just checking.
--------------------------------------------------------------------------
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