[ Obsolete | Reference Manual | Alphabetic Index ]

call_explicit(+Goal, +Module)

Succeeds if Goal which is defined in module Module succeeds.
Goal
Atom or compound term.
Module
Atom.

This built-in predicate is obsolete!

Description

This predicate provides a means to override the module system's visibility rules. While the builtins call/1 and call/2 call the predicate that is visible from a certain module, call_explicit/2 allows to call a predicate which is defined in a certain module. This allows calling a predicate that is otherwise not visible in the context module. The most plausible use of this feature is to allow local redefinition of a predicate using the existing definition in the implementation.

Note that call_explicit can only call exported or global predicates in order to preserve module privacy.

Modules

This predicate is sensitive to its module context (tool predicate, see @/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]: cd(~).
     system interface error:
                      No such file or directory in cd(~)

     [eclipse]: [user].         % redefine cd/1, using its
                              % original definition
      cd(~) :- !,
               getenv('HOME', Home),
               call_explicit(cd(Home), sepia_kernel).
      cd(Dir) :-
               call_explicit(cd(Dir), sepia_kernel).

      [eclipse]: cd(~).
      yes.

Fail:
      call_explicit(fail, sepia_kernel).

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



See Also

: / 2, call / 1, @ / 2