]> Repositorios git - scryer-prolog.git/commitdiff
findall/4 should be declared as a meta-predicate (#873)
authorMark Thom <[email protected]>
Thu, 18 Mar 2021 00:13:06 +0000 (18:13 -0600)
committerMark Thom <[email protected]>
Thu, 18 Mar 2021 00:13:06 +0000 (18:13 -0600)
src/lib/builtins.pl

index 2b42f3c74c573643e3f04dc66f35a9c3f286e4f5..0bb64f33414dc4b631dc3973d29b4c7118e07d54 100644 (file)
@@ -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).