lua-users home
lua-l archive

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


Op Vr. 12 Apr. 2019 om 17:27 het Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> geskryf:
>
> > So why aren't the paths from where the modules are loaded, simply kept in a table mapped to the module name?
>
> How would that help scripts that need to run in several environments?
> The paths are almost certainly not portable.

In my particular case, knowing whether the found file is Lua code is
already enough.

If package.found[modname] contains the result stored in *name after
 findloader(L, name);
(line 606, loadlib.c)
then my application could issue a message (and/or write it to a log file) saying

Module "complex" found as /usr/local/share/lua/5.3/complex.lua