Something to be considered with modules

As noted by Jan W. here.

If you want to make stuff from multiple modules available for interactive use you’ll generally need a non-module file that imports the modules you want to have visible.


If someone has a better name for the topic, I am listening and open to changing it.

@jan

Would load.pl be an example of a non-module file that imports the modules you want to have visible?

1 Like

Well, it is a load file that is not a module. It is a tricky file to deal with loading the Prolog part of the built-in predicates and wouldn’t call it an example for user. Just use

:- use_module(myfile1).
:- use_module(myfile2).
...

Optionally using use_module/2 to limit what is available. You can also use a module and reexport/1,2 or re-export explicitly as library(http/http_server), which imports several of the HTTP server libraries and then makes the commonly used predicates (only) available, providing a single library that is enough to get you going for most basic HTTP servers.