Stripped out modules, unit test no longer work

For me it is

how to have a large set of DCG rules split over multiple files with more than two hierarchy layers.

I don’t know an answer or even have a solution I like or would even share.

When I ran into the problem a few months ago I finally fell back to using just one or two levels of modules; can’t remember which off the top of my head, but know that when I tried three layers of modules I could see no way to make it work; I even thought about removing the module system from SWI-Prolog and growing a new one but that would make the code unusable in the wild.

I do remember that I learned a lot about multifile/1 and meta_predicate/1 in trying to understand and find a solution but using those felt more like a crutch than a simple cookie cutter solution.


I would not be so sure. Having been out on this limb for a while the only one I suspect who has an idea is Wouter Beek. Note that we both use DCGs with open list while many others used closed list.


Take a look at the other GitHub repositories that have large SWI-Prolog projects for ideas. TeamSPoon is one of my favorites.


EDIT

One thing worth looking at is Dynamic Modules. I did not try this as I was able to move along again just using fewer hierarchy levels but may circle back to this in the future when I give my code more things to solve.

While I still can’t get my head wrapped around TerminusDB that was also on my list of things to consider for solving this problem.