Tuesday 19 April 2016

How does Julia finds a module


Julia check all the paths in the global variable 'LOAD_PATH' to find a module.
julia> LOAD_PATH
2-element Array{ByteString,1}:
 "/Applications/Julia-0.4.1.app/Contents/Resources/julia/local/share/julia/site/v0.4"
 "/Applications/Julia-0.4.1.app/Contents/Resources/julia/share/julia/site/v0.4"      


You can add extra paths to the variable LOAD_PATH using push!.
julia> push!(LOAD_PATH, "/Users/harikrishna_gurram/study1/Julia/examples")
3-element Array{ByteString,1}:
 "/Applications/Julia-0.4.1.app/Contents/Resources/julia/local/share/julia/site/v0.4"
 "/Applications/Julia-0.4.1.app/Contents/Resources/julia/share/julia/site/v0.4"      
 "/Users/harikrishna_gurram/study1/Julia/examples"                                   

julia> LOAD_PATH
3-element Array{ByteString,1}:
 "/Applications/Julia-0.4.1.app/Contents/Resources/julia/local/share/julia/site/v0.4"
 "/Applications/Julia-0.4.1.app/Contents/Resources/julia/share/julia/site/v0.4"      
 "/Users/harikrishna_gurram/study1/Julia/examples"

Note
You can extend the load path by defining the variable JULIA_LOAD_PATH.



Previous                                                 Next                                                 Home

No comments:

Post a Comment