Predicates Treated in a Special Way

While qpc is compiling Prolog source into QOF, certain built-in predicates are treated in a special way. Their behavior when used as embedded commands under qpc is different from their normal behavior. For example, (A) causes the file foo.pl to be compiled into .qof format, not, as you would expect from its normal meaning, into (qpc's) memory.

     
     :- compile(foo). (A)
     

Similarly, if you define (B) in an initialization file, then the command (C) will cause foo to be compiled into QOF format after whatever goals you specified have been called.

     my_compile(File) :- (B)
         ...{some goals}...,
         compile(File).
     
     :- my_compile(foo). (C)
     

The load_files/2 when option can be used to force a file to be loaded into memory at compile-time if so desired.

Note that the change of meaning of compile/1 etc does not apply during the loading of an initialization file, only while compilation to .qof format is taking place. Thus, if you put

     :- my_compile(foo).
     

in your initialization file (after the definition of my_compile/1), then this would mean compile foo.pl into memory.

The predicates following this behavior are:


compile/1
compile files
consult/1
compile files
load_files/[1,2]
compile files
ensure_loaded/1
compile files
load_foreign_files/2
compile links to foreign code
load_foreign_executable/1
compile links to foreign code"
no_style_check/1
disable style checking
op/3
declare operator(s) (see sap-srs-ode)
reconsult/1
compile files
style_check/1
enable style checking
use_module/[1,2,3]
compile module-files
./2
(usually written [Files]) compile files

Note that an embedded command of the form

     :- compile(user).
     

will cause an error message from qpc. The same is true for specifying user in embedded calls to consult/1 and similar commands, as well as in the command line of qpc. The reason for this restriction is to avoid possible confusion; under the Development System, giving user as the argument to one of these predicates allows you to enter clauses directly from the terminal.

Clauses for the predicates foreign/[2,3] and foreign_file/2 are treated specially by qpc. They are always assumed to be compile-time predicates, to be used by a subsequent embedded load_foreign_executable/1 or load_foreign_files/2 goal. Therefore they are consulted into qpc's internal database rather than being compiled into QOF.