[m-users.] Module include and undefined symbol.

Julien Fischer jfischer at opturion.com
Sat Aug 24 23:06:17 AEST 2024


On Sat, 24 Aug 2024 at 22:10, Sean Charles (emacstheviking)
<objitsu at gmail.com> wrote:
>
> I have a module called `core` in file core.m
> I have a sub-module called `core.comments` in file core.comments.m
>
> :- module core.comments.
>
> :- interface.
> :- import_module io.
> :- import_module fm.
>
> :- pred comment_line(opstate::in, opstate::out, dstk::in, dstk::out, io::di, io::uo) is det.
> :- pred comment_parens(opstate::in, opstate::out, dstk::in, dstk::out,io::di, io::uo) is det.
>
> and my parent module is defined like this:
>
> :- module core.
> :- interface.
>
> :- import_module bool.
> :- import_module io.
>
> :- import_module fm.
> :- import_module vm.
>
> :- implementation.
> :- import_module list.
> :- import_module string.
>
> :- include_module comments.   %% <====
>
> :- import_module dstack.

You need to import core.comments in the core module as well as include
it, otherwise what
core.comments exports won't be visible to it.   (What's defined in
submodules is *not* automatically
imported into their parents.)

Julien.


More information about the users mailing list