lua-users home
lua-l archive

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


require() lets the module put it's return value in package.loaded, so
you should do the same. I believe it would be the same as:

package.loaded["name"] = dofile("modulefile")("name") == nil or true;

Technically it's not EXACTLY the same because require() allows nil to
be a result from the module, so you could simulate this behavior
(similar to how Lua does it) by using a function call to check the
number of results from dofile().

HTH,

-- 
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant