Issue #297 - Friendlier error behavior for apply

When apply attempts to execute an object of the wrong type, we now raise a useful error instead of aborting the whole program (!)
This commit is contained in:
Justin Ethier 2019-08-22 13:25:34 -04:00
parent 19ac6d32aa
commit 99c5bee97a

View file

@ -5314,9 +5314,9 @@ object apply(void *data, object cont, object func, object args)
} }
} }
default: default: {
printf("Invalid object type %d\n", type_of(func)); Cyc_rt_raise2(data, "Call of non-procedure: ", func);
exit(1); }
} }
return NULL; // Never reached return NULL; // Never reached
} }