prolog_flag/[2,3]
prolog_flag(
?FlagName,
?Value)
FlagName is a flag, which currently is set to Value.
prolog_flag(
+FlagName,
-OldValue,
+NewValue)
Unifies the current value of FlagName with OldValue and then sets the value of the flag to NewValue. The available Prolog flags are listed in ref-lps-flg.
prolog_flag/3
To inspect the value of a
flag without changing it, use prolog_flag/2
or the following
idiom, where FlagName is bound to one of the valid flags above.
| ?- prolog_flag(FlagName, Value, Value).
Use prolog_flag/2
to query and prolog_flag/3
to set values.
prolog_flag/3
can be used to save flag values so that one can
return a flag to its previous state.
For example:
... prolog_flag(debugging,Old,on), % Save in Old and set ... prolog_flag(debugging,_,Old), % Restore from Old ...
prolog_flag/2
enumerates all valid
flagnames of a given current value, or all pairs of flags and their
current values.
instantiation_error
prolog_flag/3
, FlagName unbound, or
NewValue unbound and not identical to OldValue.
type_error
domain_error
prolog_flag/3
, FlagName bound to an atom that does not
represent a supported flag, or
NewValue bound to a term that does not represent a valid value
for FlagName.
permission_error
prolog_flag/3
,
NewValue not identical to OldValue for a read-only flag.
current_prolog_flag/2
, set_prolog_flag/2
, ref-lps-flg.