lua-users home
lua-l archive

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

On Fri, Jul 6, 2012 at 6:17 PM, Andres Perera <> 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)

steve d.