lua-users home
lua-l archive

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


2010/7/29 Diego Nehab <diego@tecgraf.puc-rio.br>:
> First, let's refresh how to statically link a module in Lua. Say the
> module would be invoked as
>
>    require"foo"
>
> If it is a C module, then there is a C entrypoint luaopen_foo().
> Link the object files with your application and, during your
> initialization code, produce a Lua function from this entrypoint and
> assign it to preload["foo"] (preload is a table that lives in the
> registry). This will make sure require() doesn't look for the module
> on disk. It checks that table first.

Aren't you talking about the package.preload table ? AFAIK it's not in
the registry (here on 5.1.4 print(debug.getregistry().preload) outputs
'nil').