Merge pull request #1991 from triska/discoverable_flags

FIXED: make occurs_check and answer_write_options flags discoverable
This commit is contained in:
Mark Thom
2023-09-03 18:39:24 -06:00
committed by GitHub

View File

@@ -161,12 +161,14 @@ current_prolog_flag(Flag, OccursCheckEnabled) :-
Flag == occurs_check,
!,
'$is_sto_enabled'(OccursCheckEnabled).
current_prolog_flag(occurs_check, OccursCheckEnabled) :-
'$is_sto_enabled'(OccursCheckEnabled).
current_prolog_flag(Flag, Value) :-
Flag == answer_write_options,
!,
( iso_ext:bb_get('$answer_write_options', Value) -> true
; Value = []
).
answer_write_options(Value).
current_prolog_flag(answer_write_options, Value) :-
answer_write_options(Value).
current_prolog_flag(Flag, _) :-
atom(Flag),
throw(error(domain_error(prolog_flag, Flag), current_prolog_flag/2)). % 8.17.2.3 b
@@ -174,6 +176,11 @@ current_prolog_flag(Flag, _) :-
nonvar(Flag),
throw(error(type_error(atom, Flag), current_prolog_flag/2)). % 8.17.2.3 a
answer_write_options(Value) :-
( iso_ext:bb_get('$answer_write_options', Value) -> true
; Value = []
).
%% set_prolog_flag(Flag, Value).
%
% Sets the internal value of the flag. To see the list of flags supported by Scryer Prolog,