Next: 3.10 The Compiler
Up: 3.9 Compiling, Consulting, and
Previous: 3.9 Compiling, Consulting, and
Contents
Index
The default action upon loading a file or module is to delete all
previous byte-code for predicates defined in the file. If this is not
the desired behavior, the user may add to the file a declaration
:- multifile Predicate_List .
where Predicate_List is a list of predicates in functor/arity form. The effect of this declaration is to delete
only those clauses of predicate/arity that were defined
in the file itself. Issues to remember when using multifile in
XSB Version 3.0 are:
- If a predicate p/n is to be defined in more than one file,
p/n must be declared as multifile in each file in which it is
defined.
- The multifile declaration should be trusted only for
static code. Multifile declarations are not supported for code that
is dynamically loaded (via load_dyn/[1,2] or load_dync/[1,2]).
Other predicates for loading files are ensure_loaded/[1,2].
- ensure_loaded(+FileName)
-
This predicate checks to see whether the object file for FileName is newer than the source code and header files for FileName, and compiles FileName if not. If FileName is
loaded into memory, ensure_loaded/1 does not reload it, unlike
consult/1 which will always reload
ensure_loaded/2 is documented in Section 6.13.1.
Next: 3.10 The Compiler
Up: 3.9 Compiling, Consulting, and
Previous: 3.9 Compiling, Consulting, and
Contents
Index
Terrance Swift
2007-10-05