[m-rev.] diff: rename extras/moose/mercury.m

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 23 17:01:14 AEDT 2001


On 23-Nov-2001, Thomas Conway <conway at cs.mu.OZ.AU> wrote:
> On Thu, Nov 22, 2001 at 09:06:47PM EST, Fergus Henderson wrote:
> > extras/moose/mercury.m:
> > extras/moose/mercury_syntax.m:
> > extras/moose/moose.m:
> > 	Rename the file `mercury.m' as `mercury_syntax.m', since using the
> > 	module name `mercury' doesn't work with the `--high-level-code'
> > 	back-end (the generated header file conflicts with runtime/mercury.h).
> > 	The module name `mercury' is effectively reserved.
> 
> I don't like this *at all*! Currently we mangle names of other symbols
> to avoid clashes. Wouldn't be a better fix to mangle module names in
> some way?

The situation here is essentially a duplicate definition error:
you have two top-level modules named `mercury', on of them in
the Mercury standard library, and one in your program.

Now I know that currently there's not *actually* a module named `mercury'
in the standard library, but for the purposes of the foreign language
interface we treat the contents of the Mercury library as if it was
inside such a module, so it's reasonable to consider it that way.

If we did mangle module names, then users would have to be aware
of the module name mangling algorithm for the purposes of the foreign
language interfaces.  So I don't think that would really make users'
lives easier in the long run.

What I think we should do, however, is to detect at compile time cases
where the user tries to define a module name in the standard library,
and report the error early.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list