change variable names so that they are standard everywhere.
This commit is contained in:
parent
42442bd360
commit
e3293851a7
20
pl/utils.yap
20
pl/utils.yap
@ -59,37 +59,33 @@ call_cleanup(Goal, Cleanup) :-
|
|||||||
call_cleanup(Goal, _Catcher, Cleanup).
|
call_cleanup(Goal, _Catcher, Cleanup).
|
||||||
|
|
||||||
call_cleanup(Goal, Catcher, Cleanup) :-
|
call_cleanup(Goal, Catcher, Cleanup) :-
|
||||||
catch('$call_cleanup'(Goal,Cleanup,_),
|
catch('$call_cleanup'(Goal,Cleanup,Catcher),
|
||||||
Exception,
|
Exception,
|
||||||
'$cleanup_exception'(Exception,Catcher,Cleanup)).
|
'$cleanup_exception'(Exception,Catcher,Cleanup)).
|
||||||
|
|
||||||
'$cleanup_exception'(Exception, exception(Exception), Cleanup) :- !,
|
'$cleanup_exception'(Exception, exception(Exception), Cleanup) :- !,
|
||||||
% whatever happens, let exception go through
|
% whatever happens, let exception go through
|
||||||
(
|
catch('$clean_call'(Cleanup),_,true),
|
||||||
catch('$clean_call'(Cleanup),_,fail),
|
throw(Exception).
|
||||||
fail
|
|
||||||
;
|
|
||||||
throw(Exception)
|
|
||||||
).
|
|
||||||
'$cleanup_exception'(Exception, _, _) :-
|
'$cleanup_exception'(Exception, _, _) :-
|
||||||
throw(Exception).
|
throw(Exception).
|
||||||
|
|
||||||
'$call_cleanup'(Goal, Cleanup, Result) :-
|
'$call_cleanup'(Goal, Cleanup, Catcher) :-
|
||||||
'$freeze_goal'(Result, '$clean_call'(Cleanup)),
|
'$freeze_goal'(Catcher, '$clean_call'(Cleanup)),
|
||||||
yap_hacks:trail_suspension_marker(Result),
|
yap_hacks:trail_suspension_marker(Catcher),
|
||||||
(
|
(
|
||||||
yap_hacks:current_choice_point(CP0),
|
yap_hacks:current_choice_point(CP0),
|
||||||
'$execute'(Goal),
|
'$execute'(Goal),
|
||||||
yap_hacks:current_choice_point(CPF),
|
yap_hacks:current_choice_point(CPF),
|
||||||
(
|
(
|
||||||
CP0 =:= CPF ->
|
CP0 =:= CPF ->
|
||||||
Result = exit,
|
Catcher = exit,
|
||||||
!
|
!
|
||||||
;
|
;
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
Result = fail,
|
Catcher = fail,
|
||||||
fail
|
fail
|
||||||
).
|
).
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user