Next: ref-lps-sum, Previous: ref-lps-flg, Up: ref-lps [Contents][Index]
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:
sourceThe absolute path name of the file being loaded. During loading of a PO file, the corresponding source file name is returned.
fileOutside included files (see Include Declarations) this is the same
as the source key. In included files this is the absolute path
name of the file being included.
directoryThe absolute path name of the directory of the file being loaded. In included files this is the directory of the file being included.
moduleThe source module (see ref-mod-mne). This is useful for example
if you are defining clauses for user:term_expansion/6
and need to access the source module at compile time.
streamThe stream being loaded. This key is not available during loading of a PO file.
term_positionA term representing the stream position of the last clause read. This key is not available during loading of a PO file.