lua-users home
lua-l archive

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


Your implementation does it pretty much as how I would expect it to handle package.path, and as how I will implement it, but I can't reconcile it with what it says in the documentation (both 5.1 and 5.2):

"The path used by require to search for a Lua loader."

I read it as the path to search for the loader not the file. This could be just me interpreting it incorrectly.

Robert

----- Original Message -----
> From: "Rob Hoelz" <rob@hoelz.ro>
> 
> On 11/14/13 10:57 AM, Robert Virding wrote:
> > In require/package module there are two search paths defined: path for
> > finding a Lua loader, and cpath for finding a C loader. There is a
> > function package.searchpath for traversing a path to find a file. However,
> > I can't seem to find a path for finding the actual module to load. Is
> > there one, if so where is it? If not, how is normally this handled.
> >
> > Robert
> >
> My procure module (https://github.com/hoelzro/lua-procure) demonstrates
> how Lua's require() function works in pure Lua code.  If you're looking
> for a textual description, you can find it here:
> 
> http://www.lua.org/manual/5.1/manual.html#pdf-require
> 
> -Rob