]> Repositorios git - scryer-prolog.git/commitdiff
xor is not a standard operator
authorDan Rose <[email protected]>
Tue, 13 May 2025 20:00:00 +0000 (15:00 -0500)
committerDan <[email protected]>
Wed, 14 May 2025 01:32:59 +0000 (20:32 -0500)
src/lib/ops_and_meta_predicates.pl
src/tests/arithmetic.pl

index 8f904d63339af95e0b7b29a3fec156e14bb8f09d..8ffdfb033b582a52d5613b59bee1c3db5b1c4684 100644 (file)
@@ -26,7 +26,6 @@
 :- op(200, xfy, ^).
 :- op(500, yfx, /\).
 :- op(500, yfx, \/).
-:- op(500, yfx, xor).
 :- op(400, yfx, div).
 :- op(400, yfx, //).
 :- op(400, yfx, rdiv).
index 2e4872d47f2612e6fbb9dff2c7d83bfd2deef409..eea4b3ac8592407ff4b23cf87d13ebfac92d180d 100644 (file)
@@ -258,14 +258,14 @@ test_and_or_xor(X, Y, AndExpected, OrExpected, XorExpected) :-
     Or2 is Y \/ X,
     Or == OrExpected,
     Or == Or2,
-    Xor is X xor Y,
-    Xor2 is Y xor X,
+    Xor is xor(X, Y),
+    Xor2 is xor(Y, X),
     Xor == XorExpected,
     Xor2 == Xor,
 
     call(is, And3, X /\ Y),
     call(is, Or3, X \/ Y),
-    call(is, Xor3, X xor Y),
+    call(is, Xor3, xor(X, Y)),
     And3 == And,
     Or3 == Or,
     Xor3 == Xor.
@@ -613,7 +613,7 @@ test("and_or_xor", (
     ]), arithmetic_tests:test_and_or_xor(X, Y, AndExpected, OrExpected, XorExpected)),
     \+ catch(_ is 1 /\ 2.0, _, false),
     \+ catch(_ is 1 \/ 2.0, _, false),
-    \+ catch(_ is 1 xor 2.0, _, false)
+    \+ catch(_ is xor(1, 2.0), _, false)
 )).
 
 test("mod_rem", (