Fix halt/1 built-in predicate for ISO Prolog Core standard compliance
This commit is contained in:
@@ -1218,8 +1218,11 @@ op(Priority, OpSpec, Op) :-
|
|||||||
halt :- halt(0).
|
halt :- halt(0).
|
||||||
|
|
||||||
halt(N) :-
|
halt(N) :-
|
||||||
must_be_number(N, halt/1),
|
( var(N) ->
|
||||||
( -2^31 =< N, N =< 2^31 - 1 ->
|
throw(error(instantiation_error, halt/1)) % 8.17.4.3 a)
|
||||||
|
; \+ integer(N) ->
|
||||||
|
throw(error(type_error(integer, N), halt/1)) % 8.17.4.3 b)
|
||||||
|
; -2^31 =< N, N =< 2^31 - 1 ->
|
||||||
'$halt'(N)
|
'$halt'(N)
|
||||||
; throw(error(domain_error(exit_code, N), halt/1))
|
; throw(error(domain_error(exit_code, N), halt/1))
|
||||||
).
|
).
|
||||||
|
|||||||
Reference in New Issue
Block a user