lua-users home
lua-l archive

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


> Looking at the source, it does seem that if I want to provide some
> sort of precompiled or preloaded modules, I could simply write my own
> specialized package loader and then do
> 
>   table.insert(package.loaders, 1, myloader)
> 
> where 'myloader' returns a function on successful load, string on
> error, and nil otherwise.  Then everything would be great, right? 

Mostly right. A returned string does not mean "error", it is just an
explanation of "why" it could not load the module. If no loader
is able to load the module, then all these explanations together
are presented as the error message.

-- Roberto