January 2020
Intermediate to advanced
532 pages
13h 31m
English
When a module becomes too large, it may make sense to split it into smaller parts so that it's easier to develop and maintain. One way to solve this problem is to create submodules.
Creating submodules is convenient as they are just defined within the scope of the parent module. Let's say we organize the Calculator module with two submodules—Mortgage and Banking. These submodules can be defined in separate files and can be included directly into the parent module. Consider the following code:
# Calculator.jlmodule Calculatorinclude("Mortgage.jl")include("Banking.jl")end # module
Submodules, just like regular modules, are also defined using module blocks. The source code for Mortgage looks just like a regular module definition: ...
Read now
Unlock full access