[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What is the special function of package.preload?
- From: mniip <14@...>
- Date: Wed, 12 Aug 2015 10:17:12 +0300
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 */