summaryrefslogtreecommitdiff
path: root/stdlib.pl
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-22 18:24:58 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-22 18:24:58 +0000
commit5fe8b9865cfbd7388b8f6355a73b1436d40cfb1e (patch)
treec7ec08d8435881d103223d22672ad3d07b4d821a /stdlib.pl
parentfd10cf6997473226272b397b0ff6ebd87bd4d161 (diff)
Make predicates private and static by default, and make them dynamic when using the dynamic/1 predicate
Diffstat (limited to 'stdlib.pl')
-rw-r--r--stdlib.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdlib.pl b/stdlib.pl
index 8640bdf..bca7e31 100644
--- a/stdlib.pl
+++ b/stdlib.pl
@@ -358,6 +358,8 @@ is_list(T) :- list(T), ! ; type_error(list, T).
is_integer(T) :- integer(T), ! ; type_error(integer, T).
+is_predicate_indicator(T) :- (nonvar(T), T = N/A, integer(A), atom(N), !) ; type_error(predicate_indicator, T).
+
% All solutions
findall(Template, Goal, Instances) :-
@@ -372,7 +374,7 @@ findall(Template, Goal, Instances) :-
findall_collect([], Instances).
findall_collect(Acc, Instances) :-
- retract('find all'(Item)),
+ system:retract('find all'(Item)),
!,
findall_collect(Item, Acc, Instances).
findall_collect([], Instances, Instances).