lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Sorry if it's been already discussed...

I thought it'd be handy if we had LUA_XPATH
(similar to LUA_PATH and LUA_CPATH).

LUA_XPATH (X stands for eXecutable; name may be different)
is a string-template containing paths for search for Lua-scripts.

It could be used by:
*  Lua interpreter -- if an additional switch -x is given
*  loadfile()      -- if there's a 2nd parameter "x"
*  dofile()        -- if there's a 2nd parameter "x"

E.g., we could say:
    lua -x backup.lua
asking the interpreter to search for backup.lua on LUA_XPATH, or
    f = loadfile("myfile", "x")
to load myfile from some place on LUA_XPATH.