My Julia REPL Help provides the following for LOAD_PATH:
help?> LOAD_PATH
search: LOAD_PATH
LOAD_PATH
An array of paths for using and import statements to consdier as project environments or package directories when
loading code. See Code Loading.
Here is my output for LOAD_PATH at the prompt:
julia> LOAD_PATH # What is the output below?
3-element Array{String,1}:
"@"
"@v#.#"
"@stdlib"
The output shown above for LOAD_PATH seems strange.
Any suggestions?
What you see there is the DEFAULT_LOAD_PATH
.
Let me cite comments from the relevant section of the source code:
## LOAD_PATH, HOME_PROJECT & ACTIVE_PROJECT ##
# JULIA_LOAD_PATH: split on `:` (or `;` on Windows)
# first empty entry is replaced with DEFAULT_LOAD_PATH, the rest are skipped
# entries starting with `@` are named environments:
# - the first three `#`s in a named environment are replaced with version numbers
# - `@stdlib` is a special name for the standard library and expands to its path
In other words,
"@"
: is for loading things relative to the current path (not completely sure here, see update below)"@v#.#"
: will become the path to the v1.0
environment (assuming you are on 1.0)."@stdlib"
: will become the path to the stdlibsThis should probably be explained more precisely in the Pkg docs somewhere. Mind filing an issue over there? (UPDATE: See https://github.com/JuliaLang/Pkg.jl/issues/757)
UPDATE:
One can play around with the method Base.load_path_expand(a::AbstractString)
to see what things become eventually:
julia> Base.load_path_expand.(LOAD_PATH.*"/test")
3-element Array{String,1}:
"\\test\\Project.toml"
"C:\\Users\\carsten\\.julia\\environments\\v1.0\\test\\Project.toml"
"C:\\Users\\carsten\\.julia\\environments\\stdlib\\test\\Project.toml"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With