[m-users.] Module include and undefined symbol.
"Sean Charles (emacstheviking)" <[email protected]> Sat, 24 Aug 2024 13:09:56 +0100
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
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.
_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users