[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Search paths in require/packages
- From: Robert Virding <robert.virding@...>
- Date: Fri, 6 Dec 2013 12:46:08 +0100 (CET)
OK, I have implemented a version of require/packages for Luerl which I think follows the 5.2 standard. Are there any Lua test suites which test the internals rather than just doing require (which works)? Have I interpreted the standard correctly? Yes, I could write my own but then I wouldn't know if the test suite was correct.
Thanks for any help,
Robert
----- Original Message -----
> From: "Robert Virding" <robert.virding@erlang-solutions.com>
>
> 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
>
>