From: Mark Thom Date: Thu, 6 Sep 2018 12:16:44 +0000 (-0300) Subject: cut properly in first (,)/3 clause X-Git-Tag: v0.8.110~391^2~1 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=57ddf64cba037a3327feda62e0fe7a2f55b6d459;p=scryer-prolog.git cut properly in first (,)/3 clause --- diff --git a/src/prolog/lib/builtins.pl b/src/prolog/lib/builtins.pl index 2f939ef0..feb04e44 100644 --- a/src/prolog/lib/builtins.pl +++ b/src/prolog/lib/builtins.pl @@ -128,8 +128,9 @@ comma_errors(G1, G2, B) :- var(G1), throw(error(instantiation_error, (,)/2)). comma_errors(G1, G2, B) :- '$call_with_default_policy'(','(G1, G2, B)). :- non_counted_backtracking (,)/3. -','(!, CF, B) :- '$set_cp'(B), compound(CF), +','(!, CF, B) :- compound(CF), '$call_with_default_policy'(CF =.. [',', G1, G2]), + '$set_cp'(B), '$call_with_default_policy'(comma_errors(G1, G2, B)). ','(!, Atom, B) :- Atom == !, '$set_cp'(B). ','(!, G, B) :- '$set_cp'(B), G.