[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luaL_register 5.1
- From: David Burgess <dburgess@...>
- Date: Sat, 5 Nov 2005 00:22:38 +1100
Thanks. Was what I wanted to know.
On 11/4/05, Roberto Ierusalimschy <firstname.lastname@example.org> 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