]> Repositorios git - scryer-prolog.git/commitdiff
manually expand module names in higher-order predicates of lists.pl and give call_res...
authorMark Thom <[email protected]>
Wed, 3 Feb 2021 22:37:16 +0000 (15:37 -0700)
committerMark Thom <[email protected]>
Wed, 3 Feb 2021 22:37:16 +0000 (15:37 -0700)
src/lib/atts.pl
src/lib/lists.pl

index 8fa16e11b02d4541c219164724ce84bbc28478dd..fcd5b2c166a3ad20b78d55f540183bb6211e3a3b 100644 (file)
@@ -156,6 +156,8 @@ user:goal_expansion(Term, M:get_atts(Var, Attr)) :-
     nonvar(Term),
     Term = get_atts(Var, M, Attr).
 
+:- meta_predicate call_residue_vars(0, ?).
+
 call_residue_vars(Goal, Vars) :-
     '$get_attr_var_queue_delim'(B),
     call(Goal),
index c6160e551489935209eeb187a0832cbf328fb505..5549a061a853eed4d104199cc713819a04fa9c3c 100644 (file)
@@ -126,7 +126,7 @@ maplist(Cont, [E1|E1s], [E2|E2s], [E3|E3s], [E4|E4s], [E5|E5s], [E6|E6s], [E7|E7
 
 
 sum_list(Ls, S) :-
-        foldl(sum_, Ls, 0, S).
+        foldl(lists:sum_, Ls, 0, S).
 
 sum_(L, S0, S) :- S is S0 + L.
 
@@ -164,13 +164,13 @@ lists_transpose([L|Ls], Ts) :-
         foldl(transpose_, L, Ts, [L|Ls], _).
 
 transpose_(_, Fs, Lists0, Lists) :-
-        maplist(list_first_rest, Lists0, Fs, Lists).
+        maplist(lists:list_first_rest, Lists0, Fs, Lists).
 
 list_first_rest([L|Ls], L, Ls).
 
 
 list_to_set(Ls0, Ls) :-
-        maplist(with_var, Ls0, LVs0),
+        maplist(lists:with_var, Ls0, LVs0),
         keysort(LVs0, LVs),
         same_elements(LVs),
         pick_firsts(LVs0, Ls).
@@ -188,7 +188,7 @@ with_var(E, E-_).
 
 same_elements([]).
 same_elements([EV|EVs]) :-
-        foldl(unify_same, EVs, EV, _).
+        foldl(lists:unify_same, EVs, EV, _).
 
 unify_same(E-V, Prev-Var, E-V) :-
         (   Prev == E ->
@@ -221,13 +221,13 @@ nth0_search(N0, N, [_|Es], E) :-
 
 
 list_max([N|Ns], Max) :-
-    foldl(list_max_, Ns, N, Max).
+    foldl(lists:list_max_, Ns, N, Max).
 
 list_max_(N, Max0, Max) :-
     Max is max(N, Max0).
 
 list_min([N|Ns], Min) :-
-    foldl(list_min_, Ns, N, Min).
+    foldl(lists:list_min_, Ns, N, Min).
 
 list_min_(N, Min0, Min) :-
     Min is min(N, Min0).