From 42d3ca64597ffa5bf4f8af8b93ba61aad9c0ada9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 25 Nov 2013 12:16:10 +0100 Subject: [PATCH] avoid \! --- pl/corout.yap | 13 +++++-------- pl/preds.yap | 6 ++++++ pl/protect.yap | 6 +++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/pl/corout.yap b/pl/corout.yap index 82e401beb..78a4ccb15 100644 --- a/pl/corout.yap +++ b/pl/corout.yap @@ -157,30 +157,27 @@ redo_dif(Done, X, Y) :- dif_suspend_on_lvars(LVars, redo_dif(Done, X, Y)). redo_dif('$done', _, _). +redo_freeze(Done, V, G0) :- % If you called nonvar as condition for when, then you may find yourself % here. % % someone else (that is Cond had ;) did the work, do nothing % -redo_freeze(Done, _, _) :- nonvar(Done), !. + (nonvar(Done) -> true ; % % We still have some more conditions: continue the analysis. % -redo_freeze(Done, _, when(C, G, Done)) :- !, - when(C, G, Done). - + G0 = when(C, G, Done) -> when(C, G, Done) ; % % check if the variable was really bound % -redo_freeze(Done, V, G) :- var(V), !, - internal_freeze(V, redo_freeze(Done,V,G)). + var(V) -> internal_freeze(V, redo_freeze(Done,V,G0)) ; % % I can't believe it: we're done and can actually execute our % goal. Notice we have to say we are done, otherwise someone else in % the disjunction might decide to wake up the goal themselves. % -redo_freeze('$done', _, G) :- - '$execute'(G). + Done = '$done', '$execute'(G0) ). % % eq is a combination of dif and freeze diff --git a/pl/preds.yap b/pl/preds.yap index f32fe5c9e..f51c0948f 100644 --- a/pl/preds.yap +++ b/pl/preds.yap @@ -1093,3 +1093,9 @@ clause_property(ClauseRef, erased) :- '$instance_property'(ClauseRef, 0, true). clause_property(ClauseRef, predicate(PredicateIndicator)) :- '$instance_property'(ClauseRef, 1, PredicateIndicator). + +'$set_predicate_attribute'(M:N/Ar, Flag, V) :- + functor(P, N, Ar), + '$set_flag'(P, M, Flag, V). + + diff --git a/pl/protect.yap b/pl/protect.yap index d4058f2c4..a94d29578 100755 --- a/pl/protect.yap +++ b/pl/protect.yap @@ -48,6 +48,10 @@ '$hide'('$declare_module') :- !, fail. '$hide'('$store_clause') :- !, fail. '$hide'('$skip_list') :- !, fail. -'$hide'('$win_insert_menu_item') :- !, fail. +'$hide'('$win_insert_menu_item') :- !, fail. +'$hide'('$set_predicate_attribute') :- !, fail. +'$hide'('$parse_quasi_quotations') :- !, fail. +'$hide'('$quasi_quotation') :- !, fail. +'$hide'('$qq_open') :- !, fail. '$hide'(Name) :- hide(Name), fail.