Suppose we have a predicate p/2
that does something similar to this:
p('an atom', OutputList) :-
some_predicate_1,
some_predicate_2,
...
findall(...,...,OutputList).
p/2
does something arbitrarly complex and in the end put some result in OutputList.
Suppose I need to have the body of the predicate p/2
in a list:
Body = [some_predicate_1,...,findall(...,...,OutputList)]
and I want to execute it.
If I do something like call(Body)
, how can I retrieve OutputList
?
Is there any other predicate I can use?
Maybe call/1
or call/2
are not right for this purpose.