From 0f347162b74d945f509955b6c57e506ab800db7b Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 22 Jul 2021 19:35:53 +0000 Subject: Implement halt/0, halt/1, and understand the --no-repl flag --- stdlib.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'stdlib.pl') diff --git a/stdlib.pl b/stdlib.pl index bca7e31..19b20d0 100644 --- a/stdlib.pl +++ b/stdlib.pl @@ -683,6 +683,16 @@ current_op(Priority, Op_specifier, Operator) :- current_ops(Operators), member(op(Priority, Op_specifier, Operator), Operators). +% Halting + +halt(X) :- + is_nonvar(X), + is_integer(X), + '$halt'(X). + +halt :- + halt(0). + % Loading prolog text consult(File) :- -- cgit v1.2.3