11.3.100 include/1
[ISO,declaration]
Synopsis
:- include
+Files
Literally embed the Prolog clauses and
directives in Files into the file being loaded.
The file or files will be opened with default options.
Arguments
- :Files
- file_spec or list of file_spec, must be ground
A file specification or a list of file specifications;
extension optional.
Description
The effect is such as if the declaration itself was replaced by the
text in the Files. Including some files is thus different from
loading them in several respects:
- The embedding file counts as the source file of the predicates
loaded, e.g. with respect to the built-in predicate
source_file/2
; see ref-lps-apf.
- Some clauses of a predicate can come from the embedding file, and some
from included files.
- When including a file twice, all the clauses in it will be entered twice
into the program (although this is not very meaningful).
Exceptions
instantiation_error
-
Files not ground.
context_error
- “declaration appeared in query”
See Also
Include Declarations.
Send feedback on this subject.