2 -- the lua 5.0 loading mechanism is rather poor & relies upon the loadlib() fn
3 -- the lua 5.1 loading mechanism is simplicity itself
4 -- for now we need a bridge which will use the correct verion
6 function import_5_0(name)
7 -- imports the file into the program
8 -- for a module 'example'
9 -- this must load 'example.dll' or 'example.so'
10 -- and look for the fn 'luaopen_example()'
11 if rawget(_G,name)~=nil then return end -- module appears to be loaded
13 local lib=loadlib(name..'.dll','luaopen_'..name) or loadlib(name..'.so','luaopen_'..name)
14 assert(lib,"error loading module:"..name)
16 lib() -- execute the function: initalising the lib
17 assert(rawget(_G,name)~=nil,"no module table found")
20 function import_5_1(name)
24 if string.sub(_VERSION,1,7)=='Lua 5.0' then