lua-users home
lua-l archive

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

On 9 February 2015 at 13:26, Dirk Laurie <> wrote:
> 2015-02-09 17:19 GMT+02:00 Luiz Henrique de Figueiredo <>:
>>> > No record is kept of anything loaded with "package.loadlib".
>>> The following session strongly seems to suggest that an
>>> undocumented feature of Lua 5.3, not present in Lua 5.2,
>>> is a table in the registry keyed by the filenames of libraries
>>> loaded with "package.loadlib".
>> Ah, Lua 5.3 replaced _CLIBS by an anonymous table whose key is a userdata.
>> _CLIBS is used for cleanup. It is an implementation detail and so is not
>> documented in the manual. So, yes, "package.loadlib" does record which
>> shared libraries have been loaded. See the first lines of luaopen_package:
> It would actually be quite a useful feature to have documented.
> It allows a module that mainly does some bindings to test whether
> the calling program has preloaded a possibly customized version
> of some library that it then does not need to retrieve from some
> default source.

I'm assuming Bad Things will happen if you mess with the contents of
this table, right?

-- Hisham