On Sat, 23 Mar 2024 at 07:40, Gaius Mulley wrote:
john o goyo writes:
> [~/opt/Alice]=> gcc-git -c -fiso -I. CardBitOps.mod
> <built-in>: error: the file containing the definition module cannot be found
>
> Gaius, any insight here?
yes gm2 is trying to create a definition module symbol and cannot find
the CardBitOps.def file, and uses the builtin location (previously it
would give a misleading error message location in the implementation
module source file). Perhaps the error message could be improved
though?
I also separate .def and .mod files in my projects.
However, I put the interfaces in the top levels of each source tree directory and the implementations in their respective imp subdirectories
/src
/... any library subdirs ...
/mod
foo.mod
bar.mod
foo.def
bar.def
The reason why I believe that the interfaces belong in to the top level is that source code should always be presented for the ease of use and convenience of the reader, not for the convenience of the author. For the user/reader, the most important part of a library are the interfaces. They may never even look at the implementations, but they will need the interfaces.
Therefore, if the two are separated to reduce clutter which also makes the library easier to use for readers, then the interfaces should go in to the top level, and the implementations into a subdirectory.
Perhaps, GM2 could accommodate this kind of source tree structure with a simple compiler switch.
regards
benjamin