Modules can be brought into scope dynamically. This can be done like:
(defun test(referenced-module:module{interface-of-module})
(module::a-function-that-is-defined-on-the-interface))
This is useful for it's dynamic nature, but brings potential vulnerabilities with it. If you were to call a referenced module function, you should always try to avoid bringing capabilities into scope that guard private or sensitive functions.
So the following is HIGHLY DISCOURAGED:
(defun test(referenced-module:module{interface-of-module})
(with-capability (PRIVATE)
(module::a-function-that-is-defined-on-the-interface)))
Instead if you have a private function you want to call along side the referenced module, make sure to scope it appropiately:
(defun test(referenced-module:module{interface-of-module})
(module::a-function-that-is-defined-on-the-interface) ; either before
(with-capability (PRIVATE)
(some-private-function)) ; but not within the capability scope
(module::a-function-that-is-defined-on-the-interface)) ; or after