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

erase_module(+Module)

Erase the given module Module.

+Module
Atom.

Description

erase_module/1 erases the given module.

If the Module does not exist yet, erase_module/1 simply succeeds.

This predicate must be used carefully since the module with all its data is erased. For this reason, an error is raised when trying to erase a module from itself (error 101).

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
Module is not instantiated.
(5) Type error
Module is not an atom.
(101)
Trying to erase Module from itself.

Examples


Success:
[eclipse]: module(m).
[m]: [user].
 :- export a/0.
 a :- writeln(hello).
 user        compiled 60 bytes in 0.00 seconds
yes.
[m]: module(eclipse).
[eclipse]: import a/0 from m.
yes.
[eclipse]: a.
hello
yes.
[eclipse]: erase_module(m).
yes.
[eclipse]: a.
calling an undefined procedure a in module eclipse

Error:
    erase_module(M).                   (Error 4).
    erase_module(1).                   (Error 5).
    call(erase_module(mod), mod)       (Error 101).


See Also

begin_module / 1, create_module / 1, current_module / 1, module / 1, module_interface / 1