[ ECLiPSe Module built-in.|Group Index| Full Index]

current_module(?Module)

Succeeds if Module is an existing module.

?Module
Atom or variable.

Description

current_module/1 checks if there exists a module of a given name, or finds on backtracking the names of all the existing modules. A module exists in the system iff it has been compiled or explicitely created.

Fail Conditions

Fails if Module does not unify with an existing module.

Resatisfiable

Yes.

Exceptions

(5) Type error
Module is instantiated, but not to an atom.

Examples


Success:

    [eclipse]: current_module(M).
    M = eclipse     More? (;)
    M = sepia_kernel     More? (;)
    M = lists     More? (;)
    M = sicstus     More? (;)
    M = sorts     More? (;)
    M = cprolog     More? (;)
    M = quintus     More? (;)
    M = strings     More? (;)    % type <cr>
    yes.
Fail:
    current_module(not_a_module).
Error:
    current_module("eclipse").         (Error 5).


See Also

create_module / 1, erase_module / 1, module / 1, module_interface / 1