Loading a program is accomplished by one of these predicates
load_files(
File)
load_files(
File)
can also be
written as [
File]
.
compile(
File)
consult(
File)
compile
ensure_loaded(
File)
load_files(
File,
Options)
reconsult(
Files)
consult
The following notes apply to all the Load Predicates:
.pl
or a
.qof
suffix to a filename may be omitted (see ref-fdi-fsp-fde;)
user
Please note: If the filename is not a valid atom, it must be enclosed in single quotes. For example,
load_files(expert) load_files('Expert') compile('/usr/joe/expert') ensure_loaded('expert.pl')
absolute_file_name/2
. For information on file names refer
to ref-fdi.
fileerrors
flag is set to off
using nofileerrors/0
.
Errors detected during compilation, such as an attempt to redefine a built-in predicate, also cause exceptions to be raised. However, these exceptions are caught by the compiler, and an appropriate error message is printed.
no_style_check/1
. The possible
style warnings are:
_
are considered not named.
multifile
if its clauses
are to be spread across several different files. See the reference
page for multifile/1
.
load_files(Module:File)
can be used to load the file into the
specified module. See ref-mod-def, for information about
module-files. If a file being loaded is a module-file, it is
first loaded in the normal way, then the source module imports all the
public predicates of the module-file except for use_module
and
load_file
if you specify an import list.
:-/1
or ?-/1
, then
these are executed as they are encountered. A common type of
directive to have in a file is one that loads another
file, such as
:- [otherfile].In this case, if otherfile is a relative filename it is resolved with respect to the directory containing the file that is being loaded, not the current working directory of the Prolog system.
Any legal Prolog goal may be included as a directive. Note, however,
that if the file is compiled by qpc
, the goal will be executed by qpc
,
not when the .qof
file is loaded or when application begins execution.
The initialization/1
declaration provides this functionality.
There is no difference between a :-/1
and a ?-/1
goal in a file being compiled.
user
, or File is a list, and
during loading of the list user
is encountered, procedures are to
be typed directly into Prolog from the terminal. A special prompt,
|
, is displayed at the beginning of every new clause entered
from the terminal. Continuation lines of clauses typed at the
terminal are preceded by a prompt of five spaces. When all clauses
have been typed in, the last should be followed by an end-of-file
character.
term_expansion/2
(in module user), you can specify any desired
transformation to be done as clauses are loaded.
term_expansion/2
and all the predicates it calls,
must be treated specially if you wish to be able to compile that file
with qpc
. See sap-srs-eci-crt for information on this.
prolog_load_context/2
.