Code Loading¶
When you write a file with some code, how does Julia know where to find it?
From the REPL include(/path/to/file.jl)
does the trick. This has the same effect as typing the code in the REPL. The same can be done inside another file.
But what if you have a big chunk of code that you want to be reusable? What if you want to use someone else's code? This is where packages come into play.
The LOAD_PATH¶
You can also load modules that are not packaged as packages by putting their directories into the LOAD_PATH
environment variable.
We will not use this approach. It is easier to package everything as a package instead.