4.9.5 Load Context
When a Prolog source file is being read in, some aspects of the load
context can be accessed by the built-in predicate
prolog_load_context/2, which accesses the value of a given
key. The available keys are:
- The absolute path name of the file being loaded. During loading of a
PO file, the corresponding source file name is returned.
- Outside included files (see Include Declarations) this is the same
source key. In included files this is the absolute path
name of the file being included.
- The absolute path name of the directory of the file being
loaded. In included files this is the directory of the
file being included.
- The source module (see ref-mod-mne). This is useful for example
if you are defining clauses for
and need to access the source module at compile time.
- The stream being loaded from.
- A term representing the stream position of the last
Send feedback on this subject.