once(member(E,List))
. Implemented in C.
If List is partial though we need to do the work in Prolog to get
the proper constraint behavior. Needs to be defined early as the
boot code uses it.public
also plays this role. in SWI,
public
means that the predicate can be called, even if we cannot
find a reference to it.pred
or directive
.This implementation is used by reset/3 because the continuation cannot be captured if it contains a such a compiled temporary clause.
call((Goal, !))
.Note that we can technically also push the entire continuation onto the environment and call it. Doing it incrementally as below exploits last-call optimization and therefore possible quadratic expansion of the continuation.
I_CALLCLEANUP
, I_EXITCLEANUP
. These
instructions rely on the exact stack layout left by these
predicates, where the variant is determined by the arity. See also
callCleanupHandler()
in pl-wam.c
.-g goal
goals.Note that all goals are executed when a program is restored.
runInitialization()
in pl-wic.c for .qlf files. The
'$run_initialization'/3 is called with Action set to loaded
when called for a QLF file.query
channel. This
predicate may be hooked using confirm/2, which must return
a boolean.
Note that qlf
must be last when searching for Prolog files.
Otherwise use_module/1 will consider the file as not-loaded
because the .qlf file is not the loaded file. Must be fixed
elsewhere.
relative_to(FileOrDir)
options
or implicitely relative to the working directory or current
source-file.I think that the only sensible solution is to have a special statement for this, that may appear both inside and outside QLF `parts'.
qcompile(QlfMode)
or, if this is not present, by
the prolog_flag qcompile.Synchronisation is handled using a message queue that exists while the file is being loaded. This synchronisation relies on the fact that thread_get_message/1 throws an existence_error if the message queue is destroyed. This is hacky. Events or condition variables would have made a cleaner design.
verbose_load
flag according to Options and unify Old
with the old value.sandboxed_load
from Options. Old is
unified with the old flag.
state(FirstTerm:boolean,
Module:atom,
AtEnd:atom,
Stop:boolean,
Id:atom,
Dialect:atom)
Note that expects_dialect/1 itself may be autoloaded from the library.
swi
dialect.module(Module)
is given. In that case, use this
module and if Module is the load context, ignore the module
header.system
, while all normal user modules inherit
from user
.all
,
a list of optionally mapped predicate indicators or a term
except(Import)
.op(P,A,N)
terms representing the operators
exported from Module.sandboxed_load
is true
, this calls
prolog:sandbox_allowed_directive/1. This call can deny execution
of the directive by throwing an exception.load
or call
. Add a call
directive to the QLF file. load
directives continue the
compilation into the QLF file.load
or call
.If the cross-referencer is active, we should not (re-)assert the clauses. Actually, we should make them known to the cross-referencer. How do we do that? Maybe we need a different API, such as in:
expand_term_aux(Goal, NewGoal, Clauses)
on_error
and on_warning
flags. Also used by qsave_toplevel/0.heartbeat
is
non-zero.compileFileList()
in pl-wic.c. Gets the files from
"-c file ..." and loads them into the module user.