The module can later be unlocked by calling unlock(Module, Password).
An error is raised (error 82) when trying to re-lock a locked module. It must be unlocked first.
Success: [eclipse]: [user]. :- module(m). :- export p/0. p :- writeln(hello). user compiled 60 bytes in 0.00 seconds yes. [eclipse]: lock(m, "pass"). yes. [eclipse]: module(m). trying to access a locked module in module(m) [eclipse]: import p/0 from m. yes. [eclipse]: p. hello yes. [eclipse]: call(p) @ m. trying to access a locked module in p [eclipse]: unlock(m, "pass"). yes. [eclipse]: call(p) @ m. hello yes. Error: lock(M, "pass"). (Error 4). lock(m, Pass). (Error 4). lock(1, "pass"). (Error 5). lock(not_a_module, "pass"). (Error 80). lock(m, "pass"), call(p) @ m. (Error 82). lock(m, "pass"), lock(m, "new_pass"). (Error 82).