[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Organizing sources
- From: Andres Perera <andres.p@...>
- Date: Fri, 6 Jul 2012 11:47:15 -0430
On Fri, Jul 6, 2012 at 7:53 AM, Peng Zhicheng
<pengzhicheng1986@gmail.com> wrote:
> 于 2012-7-6 14:50, steve donovan 写道:
>
>>
>> The short answer: require() is like dofile(), in that the source is
>> separately compiled, but it looks up the source on the _module path_.
>>
>> steve d.
>>
>
> and what's more, `require' will load a chunk only once:
>
>
> the first time you `require' some module, it load the chunk,
> and caches the result (or simply a `true' if no result)
>
> all subsequent call to `require' will return the cached value.
does require() hash the pathname, inode? what's the criteria for
making an index to the cache?