Call Goal. This predicate is normally used for goals that are
not known at compile time. For example, the Prolog toplevel essentially
performs read(Goal), call(Goal). Also a meta
predicates such as ignore/1
are defined using call:
ignore(Goal) :- call(Goal), !.
Note that a plain variable as a body term acts as call/1
and the above is equivalent to the code below. SWI-Prolog produces the
same code for these two progams and listing/1
prints the program above.
ignore(Goal) :- Goal, !.
Note that call/1
restricts the scope of the cut (!/0).
A cut inside Goal only affects choice points created by Goal.
Tag confusing pages with doc-needs-help|Tags are associated to your profile if you are logged in|Report abuse