I want to implement my own maplist in Prolog .
Given the following :
myMaplist(Goal, [Elem1|Tail1], [Elem2|Tail2]) :-
apply(Goal, [Elem1, Elem2]),
myMaplist(Goal, Tail1, Tail2).
What is the apply operator , and how can I replace it with something that
is not a library system call ?
if your Prolog has call/N, use it:
otherwise build the call with univ, and use call/1
edit thanks to @false for pointing out that I must correct. To be true I posted that code without test, nevertheless I surely overlooked the bug… Here a correction
test: