From: Mark Date: Sun, 1 Oct 2023 04:22:01 +0000 (-0600) Subject: throw instantiation_error from error/2 if Error_term uninstantiated (#2060) X-Git-Tag: remove~61 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=4a8aa0acbdd9e9e17875f2c652385fb649dc7255;p=scryer-prolog.git throw instantiation_error from error/2 if Error_term uninstantiated (#2060) --- diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index ec5a9968..b7b60df9 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -2226,4 +2226,7 @@ nl(Stream) :- % % Throws an exception of the following structure: `error(ErrorTerm, ImpDef)`. error(Error_term, Imp_def) :- - throw(error(Error_term, Imp_def)). + ( var(Error_term) -> + throw(error(instantiation_error, error/2)) + ; throw(error(Error_term, Imp_def)) + ).