Loading a program is accomplished by one of these predicates
loads source or PO file(s), whichever is the more recent, according to Options.
loads source file(s) into virtual machine code.
loads source file(s) into interpreted representation.
loads source or PO file(s), whichever is the more recent, unless the file has already been loaded and it has not been modified since it was loaded.
loads module files, see ref-mod-def for information about module files.
The following notes apply to all the Load Predicates:
absolute_file_name/2. For information on file names refer to ref-fdi.
fileerrorsflag is set to
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, an appropriate error message is printed, and compilation continues.
on, but can be turned
offif desired by setting the appropriate flags, which are:
on, then warnings are printed when a sentence
(see ref-syn-syn-sen) containing variables not beginning with
‘_’ occurring once only is compiled or consulted.
The Prolog flag
legacy_char_classification (see Prolog Flags) expands the set of variable names for which warnings are
legacy_char_classification is in effect warnings
are printed also for variables that occur only once and whose name begin
with ‘_’ followed by a character that is not an uppercase Latin 1
This flag can take more values; see ref-lps-flg.
on, then the user is asked what to do when:
on, then warnings are printed when clauses are not together in
source files, and the relevant predicate has not been declared
multifileif its clauses are to be spread across several different files. See the reference page for
load_files(Module:Files)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, then it is first loaded in the normal way, the source module imports all the public predicates of the module file except for
load_files/[1,2]if you specify an import list.
?-/1, then these are executed as they are encountered. Only the first solution of directives is produced, and variable bindings are not displayed. Directives that fail or raise exceptions give rise to warning or error messages, but do not terminate the load. However, these warning or error messages can be intercepted by the hook
user:portray_message/2, which can call
abort/0to terminate the load, if that is the desired behavior.
In this case, if
otherfile is a
relative filename, then 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. There is no difference between a ‘:-/1’ and a ‘?-/1’ goal in a file being compiled.
user, or Files is a list, and during loading of the list
useris encountered, then procedures are to be typed directly into Prolog from
user_input, e.g. 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 end-of-file, or the atom
end_of_filefollowed by a full stop.
goal_expansion/5, you can specify any desired transformation to be done as clauses are loaded.