Skip to content

Commit

Permalink
add LOAD_PATH. closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Feb 10, 2012
1 parent db7df14 commit 5587896
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions j/client.j
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ function _start()
end

global const VARIABLES = {}
global const LOAD_PATH = String["", "$JULIA_HOME/", "$JULIA_HOME/j/"]

# Load customized startup
try include(strcat(getcwd(),"/startup.j")) end
Expand Down
9 changes: 6 additions & 3 deletions j/util.j
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,12 @@ function find_in_path(fname)
if fname[1] == '/'
return fname
end
loadpath = { "", "$JULIA_HOME/", "$JULIA_HOME/j/" }
for pfx in loadpath
pfxd = strcat(pfx,fname)
for pfx in LOAD_PATH
if pfx != "" && pfx[end] != '/'
pfxd = strcat(pfx,"/",fname)
else
pfxd = strcat(pfx,fname)
end
if is_file_readable(pfxd)
return pfxd
end
Expand Down

0 comments on commit 5587896

Please sign in to comment.