apply_macros.plprovides compile-time expansion for part of this library.
This module defines meta-predicates that apply a predicate on all members of a list.
call(Pred, X)succeeds and Excluded contains the remaining elements.
call(Pred, Xi, Place), where Place must be unified to one of
>. Pred must be deterministic.
call(Goal, ElemIn, _)fails are omitted from ListOut. For example (using
?- convlist([X,Y]>>(integer(X), Y is X^2), [3, 5, 4.4, 2], L). L = [9, 25, 4].
foldl(P, [X11,...,X1n], ..., [Xm1,...,Xmn], V0, Vn) :- P(X11, ..., Xm1, V0, V1), ... P(X1n, ..., Xmn, V', Vn).
scanl(P, [X11,...,X1n], ..., [Xm1,...,Xmn], V0, [V0,V1,...,Vn]) :- P(X11, ..., Xm1, V0, V1), ... P(X1n, ..., Xmn, V', Vn).