> Yes, I understand perfectly. However, according to the documentation
> for "require"
> (http://www.lua.org/manual/5.1/manual.html#pdf-require),
> after calling require ("foo") while the "foo" file begins with
> "module(bar)", the value of package.loaded["foo"] ("foo", not "bar"!)
> should be set to true, which it isn't. It's nil!
Here is what I get :
-- foo.lua
module("bar", package.seeall)
print("loading ".._NAME.." as "..(...))
-- test.lua --> the output
local tmp = require 'foo' --> loading bar as foo
print(tmp) --> true
print(package.loaded.foo) --> true
print(package.loaded.bar) --> table: 00336EC0
So if you don't get that your installation has a problem. Are you using
Lua 5.0 with compat-5.1 ?