Dodo doc > Source Files > Use of Modules
The "use" command pulls the declarations of a module in the current location. It is as if the symbols were declared here but they are actually delegated to the module.
For example:
__Module__ a (version: "1") __Header__ def c = "hello" __Module__ b (version: "1") __Main__ use a def k = c.chars # c is declared, same as a.c
The command can also be used to pull the members of an object into a type, delegating them to that object.
Since "use" pulls all the declarations it is not recommended to use it on an external module. Instead it should be used on a library which typically exports some modules, or on a service which exports the capabilities required to use that service.
To pull a single symbol just redeclare it locally.
For example:
def c = a.c # c is declared, same as a.c
The compiler can receive a list of module, library or service files which can be precompiled or not. Any module, library or service in these files is added to the predefined modules library.
That is the reason why dodo files often start with:
use modules
There is a load service which provides the capability to load a precompiled module, library or service dynamically. A dynamic module, library or service does not get added to modules so it is often made public to enable other files to use it.
The load service relies on rules described in a version.info file to select the appropriate source for each required module, library or service.