[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Finding and loading Lua files
- From: Asko Kauppi <asko.kauppi@...>
- Date: Fri, 22 Apr 2005 16:12:51 +0300
Good question, they're so obvious :D
Having "lua/5.1" in LUA_LDIR means any system scripts will remain valid
only until the user upgrades to a new X.X Lua version. Say, you have
Lua 5.1, Lumikki and Hamster installed. You "apt-get upgrade",
bringing Lua to 5.2. Poof, the scripts won't be found.
While I understand this from the 'purity' perspective (no backwards
compatibility guaranteed), it will become a pain.
What if Lumikki (in the package declaration) guarantees it can be used
with Lua >=5.0.2, <=5.2. This can be done. Where should it put the
files now? :)
I'd recommend adding "/share/lua/" to the path, after the specific
version. This way, such inter-version scripts could live in peace, and
not need to be tossed around if the engine version (slightly) changes.
22.4.2005 kello 15:54, Mike Pall kirjoitti:
Asko Kauppi wrote:
I was surprised that 5.1w4 still has:
#define LUA_PATH_DEFAULT \
"./?.lua;" LUA_LDIR "/?.lua;" LUA_LDIR "/?/init.lua"
This means, there's no common default for where system-wide library
scripts would be installed, is there?
How did you manage to miss the three lines above that define? :-)
#define LUA_ROOT "/usr/local"
#define LUA_LDIR LUA_ROOT "/share/lua/5.1"
#define LUA_CDIR LUA_ROOT "/lib/lua/5.1"