If you have:
run (X): - X.
then you can see that this is equivalent to using call/1 explicitly through
? - listing (run / 1).
run (A): -
call (A) .
It follows that call(X) also declaratively equivalent to run(X) . However, if your Prolog compiler does not perform any kind of insertion, using call/1 directly is almost certainly at least very, very slightly more efficient than calling run/1 , and call call/1 .
As food for thought, think of cases like run(!) , And how generally use ! in meta-calls can affect programs if X not equivalent to call(X) .
source share