summaryrefslogtreecommitdiff
path: root/stdlib.pl
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-22 19:35:53 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-22 19:35:53 +0000
commit0f347162b74d945f509955b6c57e506ab800db7b (patch)
treea5c5fb36dc632b5e2f387058b8170e0811001af8 /stdlib.pl
parent77c7fea4cee74562ad60c7ce96ca830a7ebda8b7 (diff)
Implement halt/0, halt/1, and understand the --no-repl flag
Diffstat (limited to 'stdlib.pl')
-rw-r--r--stdlib.pl10
1 files changed, 10 insertions, 0 deletions
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) :-