When Prolog files contain embedded commands to compile other files,
each Prolog source file is compiled into a separate QOF file with one
exception: if a module-file contains a command to load a non-module
file, then the non-module-file is compiled directly into the QOF file
corresponding to the module-file. That is, there is no separate QOF
file for a non-module-file that is loaded into a module unless it is
loaded into the default module user
. Each QOF file is written into
the same directory as the corresponding Prolog source file.
Embedded ensure_loaded/1
and use_module/[1,2,3]
commands also
cause the specified files to be compiled unless there is a
corresponding QOF file more recent than the corresponding Prolog
source file. For example,
:- ensure_loaded(file).
causes file.pl
to be compiled unless there is a file.qof
more recent
than the source. In the case where the QOF file is more recent than
the .pl
file, then the file is not compiled again. However, the QOF
file's dependencies are checked and recompiled if not up to date.