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?
What if the Lua Binaries added the paths, that LfW (Lua for Windows) uses, to their luaconf.h file.
Paths:
LUA_PATH
;;?.lua;<lua_dir>\lualibs\?.lua;<lua_dir>\lualibs\?\init.lua
LUA_CPATH
;;?.dll;<lua_dir>\clibs\?.dll;<lua_dir>\clibs\loadall.dll;<lua_dir>\clibs\?51.dll'
It seems well organized and would solve the organization problem nicely. Thoughts?
--