> Julia environments are stacked.
So just to be sure I understand this: If I
activate X then I can
using anything that’s
deved in not just
X but also anything that’s in the load path (so by default, anything up the directory hierarchy, for example)?
If that’s right then what happens when I
julia --project=@. or
Not sure if this answers your question:
As @fbanning showed, the standard LOAD_PATH has three values.
@stdlib is the standard library,
@v#.# is the base environment of your Julia version (
v1.6 for Julia 1.6 for instance, where
added packages live that weren’t added in an activated environment) and
@ refers to the currently activated environment if there is any. So when you call
using, Julia goes through those sources in order to find the package to load, starting with a possibly activated local environment, then checking the base environment, and finally checking the standard library (unless you manually modify LOAD_PATH, making it possible to add even more places to check).
When you start Julia as you wrote, you simply bind the
@ entry to the activated environment. Julia will still search the base environment and the standard lib if you try
using something that’s not in that environment.
It’s pretty simple when you think about it.