[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Organizing sources
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 6 Jul 2012 18:24:53 +0200
On Fri, Jul 6, 2012 at 6:17 PM, Andres Perera <email@example.com> wrote:
> does require() hash the pathname, inode? what's the criteria for
> making an index to the cache?
Nothing so clever ;) Lua does not know anything about directories, so
e.g on a Unix machine you will have a module path like this:
The matching is done by patterns separated by semicolons. So require
'foo' results in these candidates, after replacing ?
If we had a module like 'baggins.frodo', then the period is converted
to a slash first before searching.
Thereafter, the module name 'foo' or 'baggins.frodo' is the index
(look at the table packages.loaded)