lua-users home
lua-l archive

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

Thanks. Was what I wanted to know.

On 11/4/05, Roberto Ierusalimschy <> wrote:
> > Whwn registering a library I believe it is necessary to lua_call the
> > luaopen_ function (methinks so that LUA_ENVIRONINDEX works).
> > Someone tell me if I am wrong.
> It is not always *necessary*, but it is a good practice. luaopen_
> functions have type lua_CFunction, and therefore may assume that
> they are called following the Lua protocol.
> > My question is when I wish to add some functions to an existing
> > namespace do I also need to lua_call or can I simply call luaL_register
> > against the existing table?
> luaL_register does not have type lua_CFunction, so even if you wanted it
> would be difficult to lua_call them :) It is for "internal" use.
> -- Roberto