From: Mark Thom Date: Thu, 18 Mar 2021 00:13:06 +0000 (-0600) Subject: findall/4 should be declared as a meta-predicate (#873) X-Git-Tag: v0.9.0~124 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=b98e8c34ebd143f930124e7ae1a5d27544eec24a;p=scryer-prolog.git findall/4 should be declared as a meta-predicate (#873) --- diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index 2b42f3c7..0bb64f33 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -694,16 +694,18 @@ findall(Template, Goal, Solutions) :- '$get_lh_from_offset_diff'(LhOffset, Solutions0, Solutions1). -% :- meta_predicate findall(?, 0, ?, ?). +:- meta_predicate findall(?, 0, ?, ?). findall(Template, Goal, Solutions0, Solutions1) :- error:can_be(list, Solutions0), error:can_be(list, Solutions1), '$lh_length'(LhLength), - '$call_with_default_policy'(catch(builtins:'$iterate_find_all_diff'(Template, Goal, Solutions0, - Solutions1, LhLength), - Error, - ( builtins:truncate_lh_to(LhLength), builtins:throw(Error) ))). + '$call_with_default_policy'( + catch(builtins:'$iterate_find_all_diff'(Template, Goal, Solutions0, + Solutions1, LhLength), + Error, + ( builtins:truncate_lh_to(LhLength), builtins:throw(Error) )) + ). set_difference([X|Xs], [Y|Ys], Zs) :- X == Y, !, set_difference(Xs, [Y|Ys], Zs).