[m-dev.] op/3 declaration extent (submodules, etc), re: for review, ops.m

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Feb 20 13:50:20 AEDT 2006


On Fri, 17 Feb 2006 doug.auclair at logicaltypes.com wrote:

> Dear Julien, you wrote:
>
> >How are you intending the op/3 directive to interact with sub-modules?
> >In any case there is bunch of code in compiler/modules.m that you would need
> >to modify, in order to prevent/allow `:- op' directives being written out to
> >various types of inteface file.
>
> I had not considered the extent of op/3 declarations for submodules.  That
> is something I must explore.  Thank you for raising this issue.  As for the
> interface files, I had intended op/3 to have only implementation extent, but
> I seem to recall that 1) even implementation-only declarations being written
> out to .int? files (so I must follow through on this ... I did some cursury
> inspection already)

There are be implementation sections in the .int, .int2 files but they are
mainly used for handling abstract equivalence types.

> and 2) since this is my intent, I suppose that there is
> a way to enforce this through the process of compiliation (e.g. throwing an
> exception if the op/3 declaration is found in the interface/0 section), but
> this is something I don't know right at this moment (I will find out shortly
> (over the next few days)).  Any suggestions/starting-points?

If you don't wish to export `:- op' directives to sub-modules then you need to
make sure they aren't written out in private interface (.int0) files.  (A
private interface is how a parent module "exports" entities to its children.)
You would certainly need to modify modules.split_clauses_and_decls/3 and
possibly elsewhere in modules.m as well.

Sorting out details like this is one reason why first of all writing out the
reference manual for proposed changes like this before attempting to implement
them is a good idea.

Cheers,
Julien.
--------------------------------------------------------------------------
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