lua-users home
lua-l archive

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


From the documentation and the Lua Book, it seems to me that
"require", when succesful, should always return the table representing
the loaded module. However, it's not always the case:

In the main file, I have the following:

local mod=require("xml")

This includes the module from my file "xml.lua" which starts with:

module("MyModules.XML", package.seeall)

After this, MyModules.XML points to the module and the module itself
works as expected as expected. However, the "require" command returns
nil and "mod" variable is set to nil! Of course I can manually do
"local xml=MyModules.XML" afterwards, but is this intended? It seems
at odds with what is presented in the documentation.

(This is with Lua 5.1 on Ubuntu Linux)

--
Frantisek Fuka (yes, that IS my real name)
(and it's pronounced "Fran-tjee-shek Foo-kah")
My E-Mail: fuka@fuxoft.cz
My Homepage: http://www.fuxoft.cz
My blog: http://blog.fuxoft.cz
My Jabber/GoogleTalk ID: fuxoft@gmail.com