Suppose I have a module U of utility routines that are used by module A, which has my application. These are in files called u.jl and a.jl respectively. How do I include the utility routines in the application? It seems that there are at least four choices: (1) I can make a package and put U in the package, (2) I can include U from the repl, (3) I can put an include u.jl
statement in a.jl, but before the module A
declaration, (4) I can put include u.jl
inside a.jl inside the module A
declaration. In each of these cases except the first, the setting of LOAD_PATH
plays a role. In each of these cases, I need appropriate using
or import
statements. The cases behave differently when I make a change to u.jl while debugging a.jl. And possibly precompilation also matters.
Which of these solutions is the best? I’ve found my own solution which seems to be OK, but I would have trouble explaining these choices to someone else. An issue here is that the documentation on modules in the Julia manual is not as in-depth as the other sections. Could I request that a Julia developer who knows this material well write a more extensive commentary for that section of the manual?