[ library(lists) | Reference Manual | Alphabetic Index ]
Succeeds if Pred(Elem) succeeds for every element of List.
- Atom or compound term.
maplist/3 succeeds if for every element of List, the invocation of
Pred with one aditional argument which is this element succeeds.
The definition of this Prolog library predicate is:
:- tool(maplist/2, maplist_body/3).
maplist_body(_, , _).
maplist_body(Pred, [Head|Tail], Module) :-
maplist_body(Pred, Tail, Module).
This predicate does not perform any type testing functions.
This predicate is sensitive to its module context (tool predicate, see @/2).
Fails if at least for one element of List the invocation of Pred with this additional argument fails.
Resatisfiable if at least for one element of List the invocation of Pred with this additional argument is resatisfiable.
maplist(integer, [1, 3, 5]).
maplist(spy, [var/1, functor/3]).
maplist(current_op(_, _), [+, -, =]).
(fails because the precedence of = does not match that of +)
maplist / 3