From 7354911d0522649d3418e84e8d249c9a635dc045 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Sat, 20 Jul 2019 17:19:35 -0700 Subject: [PATCH] WTF error handler. Made it check that the unknown term really isn't a literal, definition, function, or combinator. --- thun/thun.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/thun/thun.pl b/thun/thun.pl index 985c877..0e8d2d6 100644 --- a/thun/thun.pl +++ b/thun/thun.pl @@ -88,7 +88,15 @@ 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) :- damned_thing(Unknown), write("wtf? "), writeln(Unknown), So = [[Unknown|E]|Si]. + +damned_thing(It) :- + \+ literal(It), + \+ (It ≡ _), + \+ func(It, _, _), + \+ combo(It, _, _, _, _). + /* Literals