[m-rev.] for review: make make_hlds.m a package

Julien Fischer jfischer at opturion.com
Thu Mar 31 16:10:23 AEDT 2022



On Thu, 31 Mar 2022, Zoltan Somogyi wrote:

> Make make_hlds.m a package.
> 
> compiler/make_hlds.m:
>     This module used to both
>
>     - include several submodules, and
>     - define several types and predicates.
>
>     For some years now, we have preferred to do these two kinds of things
>     in separate modules, with package modules containing *only* include_module
>     declarations, and other modules containing *no* include_module
>     declarations. The reason is that submodules of a package automatically
>     get the imports of their parent, which creates unwanted coupling
>     between the submodule and its parent. This problem vanishes if
>     the parent module contains no imports, but the only practical way
>     to sustain that over time is for the parent to define nothing.
>
>     This diff therefore moves the definitions of types and predicates
>     out of make_hlds.m. It moves the types to a new submodule,
>     make_hlds_types.m. Since the predicates it defined were only
>     forwarding predicates, they can be deleted without replacement,
>     provided that the predicates they forwarded to are in *public*
>     submodules of make_hlds.m. This diff therefore arranges that.
>     It does the same with a forwarding type.
> 
> compiler/make_hlds_types.m:
>     A new submodule of make_hlds.m that contains the type definitions
>     that used to be in make_hlds.m itself.
> 
> compiler/instance_method_clauses.m:
>     A new submodule of make_hlds.m that contains the parts of add_class.m
>     that generate the clauses the define predicates that implement

      the clauses *that* define

>     instance methods. This part of add_class.m was completely separate
>     from the rest of add_class.m (it wasn't even invoked from there),
>     so putting it in its own module eliminates unnecessary coupling.

...

That's fine otherwise.

Julien.


More information about the reviews mailing list