[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua module loader from usertype
- From: roberto@... (Roberto Ierusalimschy)
- Date: Thu, 6 Dec 2007 13:41:04 -0200
> I wrote a custom module loader using LuaJava and set it to the package
> loaders table.
> The loader is a user type with a __call int the meta table.
> My problem is, although I am sure the loader is being called and manages
> complile and push a chunk of code as the result of a loadstring operation,
> require cannot get the module - returning a boolean instead.
> Does anyone know if there's a problem returning a function from a loader in
> those conditions?
'require' does not return the module. It loads the module, *runs* it,
and returns the result. If the module has no results, 'require' returns