[m-rev.] for review: require module a.b to be a.b.m without mmc -f
Julien Fischer
jfischer at opturion.com
Sun Jan 12 21:19:40 AEDT 2020
On Sun, 12 Jan 2020, Zoltan Somogyi wrote:
> On Sun, 12 Jan 2020 19:16:32 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
>>> diff --git a/doc/reference_manual.texi b/doc/reference_manual.texi
> I am somewhat concerned by theparagraph that follows the above:
>
> The source file of a separate sub-module must contain
> the declaration (interface) and definition (implementation) of the sub-module.
> It must start with a @samp{:- module} declaration
> which matches that in the @samp{:- include_module} declaration in the parent,
> followed by the interface and (if necessary) implementation sections,
> and it may optionally end with a @samp{:- end_module} declaration.
> (Note: the module names in the @samp{:- module}, @samp{:- end_module},
> and @w{@samp{:- include_module}} declarations need not be fully-qualified.
> However, if the file name used for a particular module
> does not include all the module qualifiers,
> then the Melbourne Mercury implementation
> requires the module name in the @samp{:- module} declaration
> for that module to be fully qualified.)
>
> In particular, what *exactly* does "matches the include_module in the parent"
> mean? Most include_module items in the compiler just give the bare name
> of the submodule; they omit the name of the parent.
> So the two names definitely can differ in qualification.
The two are be allowed to differ by qualification; I think that bit
is just poorly worded.
> And the second half says effectively that the full qualification of the module name
> may come either from the :- module declaration *or* from the file name.
> What would someone be trying to achieve by not writing the fully qualified name
> in the :- module declaration? Is avoiding a dozen or three keystrokes a worthwhile
> objective for us to support?
IMO, no. We should just require that the :- module declarations in
separate sub-module are fully qualified. (In practice, most of the code
I work with already does that anyway.)
...
> I also added an entry to NEWS, with the reason for the change.
> The updated log and diff are attached.
They look fine.
Julien.
More information about the reviews
mailing list