From 2a66e7fb4756416c646ae95dad92f6654e34bfa3 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Sat, 20 Jul 2019 16:57:19 -0700 Subject: [PATCH] If I comment out the WTF handler... ...then the branch combinator works as intended. (Although the constraint-based stuff was also cool, it would have captured information from the comparison.) ?- joy(`[32 >] [++] [--] ifte`, Si, So). Si = [_6598|_6600], So = [_6598+1|_6600] ; Si = [_6598|_6600], So = [_6598-1|_6600] ; false. ?- sjc(hmm, `[32 >] [++] [--] ifte`). func(hmm, [A|B], [A+1|B]). true ; func(hmm, [A|B], [A-1|B]). true ; false. --- thun/thun.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thun/thun.pl b/thun/thun.pl index b235003..985c877 100644 --- a/thun/thun.pl +++ b/thun/thun.pl @@ -88,7 +88,7 @@ thun( [Func|E], Si, So) :- func(Func, Si, S), thun(E, S, So). thun([Combo|E], Si, So) :- combo(Combo, Si, S, E, Eo), thun(Eo, S, So). % Some error handling. -thun([Unknown|E], Si, So) :- write("wtf? "), writeln(Unknown), So = [[Unknown|E]|Si]. +% thun([Unknown|E], Si, So) :- write("wtf? "), writeln(Unknown), So = [[Unknown|E]|Si]. /* Literals