[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: LUA_PATH, luaconf.h, and ";;"
- From: David Manura <dm.lua@...>
- Date: Fri, 13 Jun 2008 03:32:19 +0000 (UTC)
I think setting LUA_PATH/LUA_CPATH environment variables globally (e.g. as Lua
for Windows currently does) could be error prone in general. This global
setting overrides the values locally defined via luaconf.h in individual Lua
instances. So, if you have an instance of Lua embedded in an application
(possibly one the user isn't even aware of), setting the global environment
variables could unintentionally break that application. That is unless one
remembers to explicitly include the sequence ";;" [1] in the global setting.
One then needs to decide whether to place the ";;" at the beginning or end of
the search path, and putting it at the beginning would be safest (local override
global).
Consider if this were reversed... Allow ";;" to optionally be specified in
luaconf.h (by default at the end of the search path) and let this represent the
search path defined in the global environment variable. Comments?
[1] http://www.lua.org/manual/5.1/manual.html#pdf-package.path