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

Sean Charles (emacstheviking) objitsu at gmail.com
Sat Aug 24 22:09:56 AEST 2024


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.


55   core("\\",          ccall(yes, comment_line)).
56   core("(",           ccall(yes, comment_parens)).

I have compared this to many examples in the Mercury source code and I am sure I have done the same as that, however the compiler remains unconvinced:

core.m:055: In clause for predicate `core'/2:
core.m:055:   in argument 2 of clause head:
core.m:055:   in argument 2 of functor `ccall/2':
core.m:055:   error: undefined symbol `comment_line'/0.
core.m:056: In clause for predicate `core'/2:
core.m:056:   in argument 2 of clause head:
core.m:056:   in argument 2 of functor `ccall/2':
core.m:056:   error: undefined symbol `comment_parens'/0.
** Error making `Mercury/cs/core.c'.

It's the first time I've used this feature.

TIA,
Sean.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20240824/8c358811/attachment.html>


More information about the users mailing list