lua-users home
lua-l archive

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


----- Original Message -----
> From: "Jerome Vuarand" <jerome.vuarand@gmail.com>
> 
> 2013/11/23 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.
> 
> The two paths are used by searchers, which role is to find and return
> loaders, not files. The require function itself has no concept of
> file, only searchers, loaders, and modules. Some modules may not have
> an associated file. So writing "used by require to search for a [...]
> file" wouldn't make sense.
> 
> It could read "The path used by the Lua module searcher to find a Lua
> module file.". But is that clearer?

Yes, it is clearer. The current sentence implies that used to FIND a loader and not that it is used BY a loader. Require doesn't directly know about files although it does know about an extra argument apart from the module name which is passed in the call to the loader.

Anyway I still need some tests to test that I gotten the internals working the right way, at least the bits that can be called by Lua.

Robert