
unlock(+Module, +Password)

   Unlocks the access to the module Module, if the password given in Password
is correct



Arguments
   Module              Atom.
   Password            String.

Type
   Modules

Description
   unlock(Module, Password) unlock a module previously locked with
   lock_pass(Password).  The access to the module is now again possible.


   An error is raised (and the module not unlocked) when trying to unlock a
   module with a wrong password or when trying to unlock a module locked
   with lock/0.




Modes and Determinism
   unlock(+, +) is det

Exceptions
     4 --- Module or Password is/are not instantiated.
     5 --- Module is instantiated, but not to an atom or Password is    instantiated but not to a string.
    80 --- Module is not a module.
    82 --- Trying to access a locked module Module
    98 --- Key not correct

Examples
   
    % After compiling the following code:
     :- module(m).
     :- export pub/0.
     pub :- writeln(pub).
     priv :- writeln(priv).
     :- lock_pass("secret").


    ?- module(m).
    trying to access a locked module in module(m)

    ?- call(pub) @ m.
    pub
    yes.

    ?- call(priv) @ m.
    trying to access a locked module in priv

    ?- assert(foo) @ m.
    trying to access a locked module in assert_(foo, m)

    ?- unlock(m, "pass").
    key not correct in unlock(m, "pass")

    ?- unlock(m, "secret").
    yes.

    ?- call(priv) @ m.
    priv
    yes.

    ?- assert(foo) @ m.
    yes.


See Also
   lock / 0, lock_pass / 1, get_module_info / 3
