From 5fe8b9865cfbd7388b8f6355a73b1436d40cfb1e Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 22 Jul 2021 18:24:58 +0000 Subject: Make predicates private and static by default, and make them dynamic when using the dynamic/1 predicate --- stdlib.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stdlib.pl') 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). -- cgit v1.2.3