<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Somedays I despair at my seeming lack of brain power, this is two of them.<div>OK, so I modified my code:</div><div><br></div><div><div><font face="Andale Mono">:- implementation.</font></div><div><font face="Andale Mono">:- import_module list.</font></div><div><font face="Andale Mono">:- import_module string.</font></div><div><font face="Andale Mono">:- import_module core.comments.</font></div><div><font face="Andale Mono">:- import_module core.stackops.</font></div><div><font face="Andale Mono">:- import_module dstack.</font></div><div><font face="Andale Mono"><br></font></div><div><font face="Andale Mono">:- include_module comments.</font></div><div><font face="Andale Mono">:- include_module stackops.</font></div><div><br></div><div>And it has compiled. Hurrah for our side etc.</div><div><br></div><div>So, just for the slow amongst us...</div><div> * I have to import the module in order to see its exported interface (as with any other module)</div><div> * I have to include the module to get the compiler to process the implementation code in the submodule.</div><div><br></div><div>It's not exactly how I though it worked, but then nothing ever is, it just feels odd that I have to import and include but I am sure there are vey good reasons for it not being automatic i.e. it might remove some flexibility and freedoms somewhere else I guess.</div><div><br></div><div>I believe this is the relevant oart of the docs, 9.3.3, Visibility rules:</div><div><br></div><div><span style="font-size: medium; background-color: rgb(255, 255, 255);"><i> Declarations in a child module are not visible in the parent module, or in “sibling” modules</i></span></div><div><span style="font-size: medium; background-color: rgb(255, 255, 255);"><i> (other children of the same parent), or in other unrelated modules unless the child is explicitly</i></span></div><div><i><span style="font-size: medium; background-color: rgb(255, 255, 255);"> imported using an ‘</span><samp>:- import_module</samp><span style="font-size: medium; background-color: rgb(255, 255, 255);">’ or ‘</span><samp>:- use_module</samp><span style="font-size: medium; background-color: rgb(255, 255, 255);">’ declaration. It is an error</span></i></div><div><span style="font-size: medium; background-color: rgb(255, 255, 255);"><i> to import a module without importing all of its parent modules.</i></span></div><div><span style="font-size: medium; background-color: rgb(255, 255, 255);"><br></span></div><div><span style="font-size: medium; background-color: rgb(255, 255, 255);"><br></span></div><div>Thanks for putting up with me,</div><div>I am going to go outside and run my through the mangle for a bit, it hurtsd less.</div><div><br></div><div>Sean.</div><div><br></div><div><br><div><blockquote type="cite"><div>On 24 Aug 2024, at 14:06, Julien Fischer <jfischer@opturion.com> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">On Sat, 24 Aug 2024 at 22:10, Sean Charles (emacstheviking)</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><</span><a href="mailto:objitsu@gmail.com" style="font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">objitsu@gmail.com</a><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">> wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br>I have a module called `core` in file core.m<br>I have a sub-module called `core.comments` in file core.comments.m<br><br>:- module core.comments.<br><br>:- interface.<br>:- import_module io.<br>:- import_module fm.<br><br>:- pred comment_line(opstate::in, opstate::out, dstk::in, dstk::out, io::di, io::uo) is det.<br>:- pred comment_parens(opstate::in, opstate::out, dstk::in, dstk::out,io::di, io::uo) is det.<br><br>and my parent module is defined like this:<br><br>:- module core.<br>:- interface.<br><br>:- import_module bool.<br>:- import_module io.<br><br>:- import_module fm.<br>:- import_module vm.<br><br>:- implementation.<br>:- import_module list.<br>:- import_module string.<br><br>:- include_module comments. %% <====<br><br>:- import_module dstack.<br></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">You need to import core.comments in the core module as well as include</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">it, otherwise what</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">core.comments exports won't be visible to it. (What's defined in</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">submodules is *not* automatically</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">imported into their parents.)</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Julien.</span></div></blockquote></div><br></div></div></body></html>