[m-rev.] for review: Document that `:- module' for separate submodules must be fully qualified.
Julien Fischer
jfischer at opturion.com
Tue Jan 14 16:08:49 AEDT 2020
Hi Peter,
On Tue, 14 Jan 2020, Peter Wang wrote:
> doc/reference_manual.texi:
> Document the new requrement on `:- module' declarations for separate
Spelling: requirement.
> submodules. Note that the implementation allows partial
> qualification in the corresponding `:- end_module' declaration.
>
> Clarify that a sentence applies to declarations for *nested*
> submodules.
>
> Reword the second of two paragraphs beginning with "Note that".
>
> NEWS:
> Announce the change.
>
> diff --git a/NEWS b/NEWS
> index 9a10ff60c..737dcdaab 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -98,6 +98,9 @@ Changes that may break compatibility
> standard library module `lexer`, or a submodule of a user-written
> parent module. [Mantis bug #489].
>
> +* The `:- module` declaration in a separate sub-module now must contain the
> + fully qualified module name.
s/sub-module/submodule/ for consistency with the rest of the file.
(Actually, perhaps we should do the reverse in the NEWS file since the
rest of the Mercury documentation seems to use sub-module.)
> +
> * References to everything imported via `:- use_module` declarations
> must now be fully module qualified.
>
> diff --git a/doc/reference_manual.texi b/doc/reference_manual.texi
> index 54656e5d2..10cbc76bb 100644
> --- a/doc/reference_manual.texi
> +++ b/doc/reference_manual.texi
...
> @@ -5358,16 +5358,9 @@ with a list of the file names of all the Mercury modules in the program.)
> 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,
> +containing the fully qualified module name,
> followed by the interface and (if necessary) implementation sections,
> and it may optionally end with a @samp{:- end_module} declaration.
And is that end_module declaration allowed to be not fully qualified?
> -(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.)
There is now nothing (I think) saying whether the names appearing in
include_module declarations should be qualified, unqualified, partially
qualified etc. I think there needs to be.
Julien.
More information about the reviews
mailing list