lua-users home
lua-l archive

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




On Tue, Sep 22, 2015 at 12:40 AM, Milind Gupta <milind.gupta@gmail.com> wrote:
I   use   just   that.   I   use  lua_init  env  variable  to  set  my
pakage.loaders/searchrs.   I   use   strings   for   pakage.path   like
`*\share\?.lua;lua*\share\?.lua;lua-*\share\?.lua`.  Where  `*` is lib
name  which calculate as first part in require argument. This does not
works  for  some modules like `mime` from luasocket or `re` from lpeg.
for  such  modules  i  have table to associate them with library. Also
my loadrs update %PATH% env variable for current process. So I have
separate directory for library which contain `share` dir with all
modules,  `test`  dir  with  tests,  `doc`  dir with documentation and
`path`  dir with external deps (e.g. libuv.dll for lluv or zmq.dll for
lzmq). `path` adds to process env %path% variable just before loading lua
module.  So  you  can use specific version for lua module. E.g. I have
several  openssl  in  my  %PATH%  but  lua module have to use specific
version.

One thing I see is that LUA_INIT is checked by the lua.exe program not by core Lua. So if you create a lua thread with llthreads or create a new lua_state which executes some lua code then that will not see the LUA_INIT updates automatically. Or am I missing something?