add meta-predicate declarations before their definitions
This commit is contained in:
@@ -11,6 +11,12 @@
|
|||||||
|
|
||||||
:- use_module(library(error), [can_be/2,domain_error/3]).
|
:- use_module(library(error), [can_be/2,domain_error/3]).
|
||||||
|
|
||||||
|
|
||||||
|
:- meta_predicate call_cleanup(0, 0).
|
||||||
|
|
||||||
|
:- meta_predicate setup_call_cleanup(0, 0, 0).
|
||||||
|
|
||||||
|
|
||||||
forall(Generate, Test) :-
|
forall(Generate, Test) :-
|
||||||
\+ (Generate, \+ Test).
|
\+ (Generate, \+ Test).
|
||||||
|
|
||||||
@@ -23,9 +29,9 @@ bb_put(Key, _) :- throw(error(type_error(atom, Key), bb_put/2)).
|
|||||||
|
|
||||||
bb_b_put(Key, NewValue) :-
|
bb_b_put(Key, NewValue) :-
|
||||||
( '$bb_get_with_offset'(Key, OldValue, OldOffset) ->
|
( '$bb_get_with_offset'(Key, OldValue, OldOffset) ->
|
||||||
call_cleanup((iso_ext:store_global_var_with_offset(Key, NewValue) ; false),
|
call_cleanup((store_global_var_with_offset(Key, NewValue) ; false),
|
||||||
reset_global_var_at_offset(Key, OldValue, OldOffset))
|
reset_global_var_at_offset(Key, OldValue, OldOffset))
|
||||||
; call_cleanup((iso_ext:store_global_var_with_offset(Key, NewValue) ; false),
|
; call_cleanup((store_global_var_with_offset(Key, NewValue) ; false),
|
||||||
reset_global_var_at_key(Key))
|
reset_global_var_at_key(Key))
|
||||||
).
|
).
|
||||||
|
|
||||||
@@ -46,15 +52,11 @@ bb_get(Key, Value) :- atom(Key), !, '$fetch_global_var'(Key, Value).
|
|||||||
bb_get(Key, _) :- throw(error(type_error(atom, Key), bb_get/2)).
|
bb_get(Key, _) :- throw(error(type_error(atom, Key), bb_get/2)).
|
||||||
|
|
||||||
|
|
||||||
:- meta_predicate call_cleanup(0, 0).
|
|
||||||
|
|
||||||
call_cleanup(G, C) :- setup_call_cleanup(true, G, C).
|
call_cleanup(G, C) :- setup_call_cleanup(true, G, C).
|
||||||
|
|
||||||
|
|
||||||
% setup_call_cleanup.
|
% setup_call_cleanup.
|
||||||
|
|
||||||
:- meta_predicate setup_call_cleanup(0, 0, 0).
|
|
||||||
|
|
||||||
setup_call_cleanup(S, G, C) :-
|
setup_call_cleanup(S, G, C) :-
|
||||||
'$get_b_value'(B),
|
'$get_b_value'(B),
|
||||||
call(S),
|
call(S),
|
||||||
|
|||||||
Reference in New Issue
Block a user