Merge pull request #787 from triska/rebis-dev

add meta_predicate declaration for with_local_attributes/3
This commit is contained in:
Mark Thom
2021-02-03 15:51:15 -07:00
committed by GitHub

View File

@@ -5884,9 +5884,11 @@ difference_arcs([V|Vs], FL0) -->
writeln(T) :- write(T), nl. writeln(T) :- write(T), nl.
:- meta_predicate must_succeed(0).
must_succeed(G) :- must_succeed(G) :-
(G -> true ( G -> true
;write(failed-G), halt ; throw(failed-G)
). ).
enumerate([], _) --> []. enumerate([], _) --> [].
@@ -6047,6 +6049,8 @@ remove_attr(Var, Attr) :-
functor(Term, Attr, 1), functor(Term, Attr, 1),
put_atts(Var, -Term). put_atts(Var, -Term).
:- meta_predicate with_local_attributes(?, 0, ?).
with_local_attributes(Vars, Goal, Result) :- with_local_attributes(Vars, Goal, Result) :-
catch((Goal, catch((Goal,
maplist(del_all_attrs, Vars), maplist(del_all_attrs, Vars),