[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaL_register 5.1
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 04 Nov 2005 10:35:34 -0200
> 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