[mercury-users] Custom declarations and preprocessors.

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Apr 17 19:37:13 AEST 2000


On 17-Apr-2000, Richard Tucker <rit at cam.sri.com> wrote:
> At 16:36 2000-04-17 +1000, Tyson Dowd wrote:
> >
> >The change I'm considering is allowing the compiler to ignore your
> >declarations (with a compiler option) and to provide some sample code
> >for writing Mercury source processors.
> 
> If you do this, then have you considered restricting the namespace to
> which it applies? Otherwise, if you ever want to add a new declaration
> to the language, you can't be sure that someone isn't already using it.
> (Alternatively, you could promise that any future declarations added
> to the language will be in a restricted namespace.)

Hmm, good point.

> I guess the same
> issues apply to predicate names, but there it doesn't matter so much
> because of the module system (as long as you don't add predicates to
> modules once they are stable). Module names, on the other hand, would
> appear to suffer from this problem already.

We plan to address this in version 2 of the standard library,
by using sub-modules, and making all the modules in the current
standard library sub-modules of a single module `std'.

There used to be a similar problem with module names used in
our debugger library (which included some commonly used module
names such as `util', `parse', `browse', etc.), since when you
compile with debugging enabled the debugger library gets linked
into the executable.  In our latest development versin, we have
solved this by making all of these module sub-modules of `mdb'.

The main reason that we haven't yet done the same for the standard
library is that it would break backwards compatibility.

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



More information about the users mailing list