From 0478e6930517d63b30630c88a815d99f6e756c09 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Tue, 20 Jul 2021 23:17:16 +0000 Subject: Throw errors when trying to evaluate goals that cannot be evaluated --- eval.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 09bb009..e57f28f 100644 --- a/eval.c +++ b/eval.c @@ -28,6 +28,11 @@ evalquery(Term *query) 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; -- cgit v1.2.3