| Did you know ... | Search Documentation: |
| Predicate set_prolog_flag/2 |
permission_error. If
the provided Value does not match the type of the flag, a
type_error is raised.
Some flags (e.g., unknown) are maintained on a per-module basis. The addressed module is determined by the Key meta argument.
In addition to ISO, SWI-Prolog allows for user-defined Prolog flags.
New Prolog flags should be created using create_prolog_flag/3.
For historical reasons set_prolog_flag/2
silently creates a Prolog flag if the Prolog flag user_flags
is true (default), i.e., set_prolog_flag/2
behaves as if defined below.
set_prolog_flag(Key, Value) :-
current_prolog_flag(Key, _),
!,
<set the flag>.
set_prolog_flag(Key, Value) :-
current_prolog_flag(user_flags, true),
!,
create_prolog_flag(Key, Value, []).
set_prolog_flag(Key, _) :-
existence_error(prolog_flag, Key).