Previous Up Next

6.5  Module Compilation

One source file can contain several modules and one module may spread over several files3. The module structure is controlled by the module/1 directive which tells the compiler that all subsequent input up to the end of file or another module directive will be part of the given module.

When it encounters the module/1 directive, the compiler first erases previous contents of this module, if there was any, before starting to compile predicates into it. This means that if the contents of a module has to be generated incrementally, the module directive cannot be used because the previous contents of the module would be destroyed. In this case the predicate compile(File, Module) should be used.


Previous Up Next