I’m currently using Julia for the first time in a project of more than one file and I’m struggling with
For this example, let say that I have a few files :
small3.jl I have some functions that I would like to use in the 3 others files. In
big.jl I would like use some functions from the 3 small files. Also, in
big.jl I created a module :
module Big include("small1.jl") include("small2.jl") include("small3.jl") ... other stuff end
Since we are collaborating on that project, we found it important to be able to read and understand easily the codes. So, we would like to be able to know where each functions are defined.
For example, in
small2.jl I would like to be able to call functions from
small3.foo(...) or something similar.
We can do that by putting everything in
small3.jl into a module. But, then if I included
big.jl I got some warning telling me that the module in
small3.jl have been included more than once when I included
The other way that we found is to only include
big.jl and not in the two others files. Since both
small2.jl are included in
big.jl we can call
big.small3.foo(...) in those file. But, it’s not exactly what I wanted first. The other problem is that if I create a new module that used
big than it looks like I need to call the function like this
Finally, my question is : What is the Julia way to do that kind of thing?