By default, predicates defined in one module cannot be called from another module. This section enumerates the exceptions to this—the ways in which a predicate can be visible to modules other than the one in which it is defined.
:/2
operator. The module prefix
overrides the default module. For example,
:- mod:foo(X,Y).
always calls foo/2
in module mod. This is effectively a
loophole in the module system, which allows you to override the normal
module visibility rules. It is intended primarily to facilitate program
development and debugging, and it should not be used extensively since it
subverts the original purposes of using the module system.
Note that a predicate called in this way does not necessarily have to be defined in the specified module. It may be imported into it. It can even be a built-in predicate, and this is sometimes useful—see ref-mod-som, for an example.