Is it "valid" to do luaL_setfuncs() multiple time one the same table.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it "valid" to do luaL_setfuncs() multiple time one the same table.

Laurent FAILLIE
Hello,

I'm registering some function to a table using luaL_setfuncs().

Is it valid to register addition function afterward by calling a second time luaL_setfuncs() on the same time ?

Same question with luaL_register() on 5.1 :)

Thanks

Laurent
Reply | Threaded
Open this post in threaded view
|

Re: Is it "valid" to do luaL_setfuncs() multiple time one the same table.

Luiz Henrique de Figueiredo
> Is it valid to register addition function afterward by calling a second time
> luaL_setfuncs() on the same time ?

Yes. See https://www.lua.org/source/5.3/lauxlib.c.html#luaL_setfuncs

> Same question with luaL_register() on 5.1 :)

Yes. See https://www.lua.org/source/5.1/lauxlib.c.html#luaI_openlib
though it's harder to follow.

Reply | Threaded
Open this post in threaded view
|

Re: Is it "valid" to do luaL_setfuncs() multiple time one the same table.

Laurent FAILLIE
Thanks Luiz, but my question is more to know if it will remain in the future ?

Le vendredi 4 mai 2018 à 00:15:12 UTC+2, Luiz Henrique de Figueiredo <[hidden email]> a écrit :


> Is it valid to register addition function afterward by calling a second time
> luaL_setfuncs() on the same time ?

Yes. See https://www.lua.org/source/5.3/lauxlib.c.html#luaL_setfuncs


> Same question with luaL_register() on 5.1 :)


Yes. See https://www.lua.org/source/5.1/lauxlib.c.html#luaI_openlib
though it's harder to follow.