January 2020
Intermediate to advanced
532 pages
13h 31m
English
If the sub-module needs access to any symbol from the parent module, then the sub-module may use the import or using statement while adding .. as a prefix to the name of the parent module. This is shown with the following code:
# Mortgage.jlmodule Mortgage# access to parent module's variableusing ..Calculator: days_per_yearend # module
Now, the Mortgage sub-module has access to the days_per_year constant from the parent module.
Having the ability to reference symbols and functions between modules and sub-modules allows us to just reorganize code into various sub-modules and keep it working as before. However, the reason for separating code into sub-modules in the first place is to allow the developer ...
Read now
Unlock full access