From: Mark Thom Date: Sat, 26 Feb 2022 17:57:52 +0000 (-0700) Subject: add proper error throwing for call_with_inference_limit/3 (#1296) X-Git-Tag: v0.9.0^2~11 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=96faad1c0147565ebd86f313adef4f857fc9e102;p=scryer-prolog.git add proper error throwing for call_with_inference_limit/3 (#1296) --- diff --git a/src/lib/iso_ext.pl b/src/lib/iso_ext.pl index 37044a40..e614b1f6 100644 --- a/src/lib/iso_ext.pl +++ b/src/lib/iso_ext.pl @@ -137,6 +137,15 @@ handle_ile(B, E, _) :- :- meta_predicate(call_with_inference_limit(0, ?, ?)). call_with_inference_limit(G, L, R) :- + ( integer(L) -> + ( L < 0 -> + domain_error(not_less_than_zero, L, call_with_inference_limit/3) + ; true + ) + ; var(L) -> + instantiation_error(call_with_inference_limit/3) + ; type_error(integer, L, call_with_inference_limit/3) + ), '$get_current_block'(Bb), '$get_b_value'(B), '$call_with_default_policy'(call_with_inference_limit(G, L, R, Bb, B)),