lua-users home
lua-l archive

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


On 08/12/2015 06:17 AM, Nan Xiao wrote:
> Hi all,
> 
> After reading require <http://www.lua.org/manual/5.3/manual.html#pdf-require>
> section, I am a little confused about the function of package.preload, and it seems
> that package.loaded is enough.
> 
> Why does Lua provide package.preload? Is there any special usage function?
> 
> Thanks in advance!
> 
> Best Regards
> Nan Xiao

You should put built-in modules there. For example if your program has luasocket
built-in, upon initialization it makes sense to stuff it into package.preload.

-- 
/* mniip */