[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Inconsistency regarding the packagemodel, call for updates of the reference manual.
- From: roberto@... (Roberto Ierusalimschy)
- Date: Thu, 17 May 2007 22:13:18 -0300
> 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.