Interpreting LOAD_PATH in 1.0

What does the @ sign mean? I tried to look it up from the manual but couldn’t find it…

julia> LOAD_PATH
3-element Array{String,1}:
 "@"      
 "@v#.#"  
 "@stdlib"
1 Like

I had the same question and couldn’t find an answer elsewhere, but I did find this. All I can say for sure is that @stdlib gets expanded to Sys.STDLIB.

Here in line 148 @ gets expanded to the output of active_project (my guess is what, if anything, is active in the Pkg REPL) and @v#.# gets expanded to, in our case, @v1.0. My wild guess is something in your ~/.julia/v1.0 folder.

After even more investigating (link looks to be somewhat out of date), I got to playing around with functions in Base and stumbled on Base.load_path():

julia> Base.load_path()
3-element Array{String,1}:
 "/home/alan/repos/JuDO.jl/Project.toml"
 "/home/alan/.julia/environments/v1.0/Project.toml"
 "/opt/julia-1.0.0/share/julia/stdlib/v1.0"

I in fact do have JuDO.jl active in my Pkg REPL, the environments/v1.0/Project.toml points to installed packages, and stdlib speaks for itself.

I wish this were in the docs (Base.load_path() seems to be undocumented) but I’m guessing that LOAD_PATH isn’t something you need to look at anymore.

2 Likes

Out of interest:
Regarding the stdlib, at my Julia it points to the folder which contains the packages, such as “Linear Algebra”. So what is the meaning of the other two entries of the Base.load_path and why are they not located inside the same main directory?

The docstring of LOAD_PATH should explain everything.

(Also, please don’t revive very old topics).