[m-dev.] Re: conditional compilation

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Jan 6 11:49:04 AEDT 2010

Hi all (and happy new year),

On Tue, 5 Jan 2010, Peter Wang wrote:

> On 2010-01-05, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
>> On Tue, Jan 05, 2010 at 05:41:08PM +1100, Peter Wang wrote:
>>> With conditional implementation sections I could cleanly separate the
>>> two completely different implementations, while providing the single
>>> module interface.
>> An extra benefit that we can get here is that the 'disabled' sections can be
>> error checked but not compiled.  This can help us verify that these sections
>> are correct even when they aren't applicable to the current backend/platform.
> Actually, probably not.

I am strongly opposed to not always checking the conditional
sections.  We already have this problem to some extent with Mercury
clauses not being checked in the presence of foreign clauses.
I definitely do not want C style conditional compilation (i.e. no
checking of the alternatives) in Mercury.

Some other observations related to this thread:

(1) the reference manual doesn't actually specify what an implementation
(or for that matter, interface) section is.  There is a long standing
XXX regarding this.

(2) It seems that with this feature then private interface files, .int0,
will depend upon what compiler flags are given, i.e. they will have to
become grade dependent (they currently aren't).
(This assumes that the visibility rules for conditional implementation
sections w.r.t to sub-modules are the normal ones.)

mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au

More information about the developers mailing list