ref: 0478e6930517d63b30630c88a815d99f6e756c09
parent: 901224d36c3f488e4118a1fd804da2b3372d8ed6
author: Peter Mikkelsen <peter@pmikkelsen.com>
date: Tue Jul 20 19:17:16 EDT 2021
Throw errors when trying to evaluate goals that cannot be evaluated
--- a/eval.c
+++ b/eval.c
@@ -28,6 +28,11 @@
if(flagdebug)
print("Working goal: %S:%S\n", module->name, prettyprint(goal, 0, 0, 0, nil));
+ if(goal->tag == VariableTerm)
+ goal = instantiationerror();
+ if(goal->tag != AtomTerm && goal->tag != CompoundTerm)
+ goal = typeerror(L"callable", goal);
+
Binding *bindings = nil;
Clause *clause = nil;