WTF error handler.
Made it check that the unknown term really isn't a literal, definition, function, or combinator.
This commit is contained in:
parent
2a66e7fb47
commit
7354911d05
10
thun/thun.pl
10
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue