strangely (at least I think it is strange) this results in the following
[bernd@impact36 lua_lib]$ lua chunk1.lua
lua: chunk1.lua:1: cannot find compat-5.1 in
[C]: in function `error'
chunk1.lua:1: in main chunk
The error actually comes out of the file it claims not to find??
/madras/bernd/impact4-t/lua/lua_lib/compat-5.1.lua:70 which is I guess
Yes I know, LUA_INIT has it already but I try to figure out why some of
our lua libraries which are required twice (because of dofile) actually
work the first time round but fail the second time round (even if
_LOADED says it is loaded already).
> Yes I know, LUA_INIT has it already but I try to figure out why some of
> our lua libraries which are required twice (because of dofile) actually
> work the first time round but fail the second time round (even if
> _LOADED says it is loaded already).
> Am I just missing something here??
The bug is that compat-5.1.lua should register itself, like:
package.loaded["compat-5.1"] = true
Sorry about that. You could add that line somewhere in the
file. You could check for _COMPAT51 global variable, which is defined
by the file, and decide if you have to require it or not.