[ Obsolete | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

call(+Goal, +Module)

Succeeds if Goal (which is visible in module Module) succeeds.
Goal
Atom or compound term.
Module
Atom.

This built-in predicate is obsolete!

Description

Calls a goal Goal from the module Module. This predicate is used to call goals whose functors and visibility are known only at the time they are called. It may be used to implement tool bodies.

Note that !/0 does not cut through call/2.

Fail Conditions

Fails if Goal fails

Resatisfiable

Resatisfiable if Goal is resatisfiable

Exceptions

(4) instantiation fault
Goal is not instantiated.
(4) instantiation fault
Module is not instantiated.
(5) type error
Goal is neither an atom nor a compound term.
(5) type error
Module is not an atom.
(68) calling an undefined procedure
Goal is an undefined procedure in Module.

Examples

Success:
      [eclipse]: [user].
       :-module(m).
       p.
       user        compiled 28 bytes in 0.00 seconds
      yes.
      [eclipse]: p.
      calling an undefined procedure p in module eclipse
      [eclipse]: call(p, m).
      yes.

Fail: call(fail, any).

Error:
      call(Var,eclipse).                (Error 4).
      call(ls,Var).                     (Error 4).
      call("write(a)",eclipse).         (Error 5).
      call(foo(a),eclipse).             (Error 68).



See Also

call / 1, @ / 2, : / 2