LUA_SETFIELD(3) Library Functions Manual LUA_SETFIELD(3)

lua_setfieldpops the value from the stack, function indicator [-1, +0, e]

#include <lua.h>

void
lua_setfield(lua_State *L, int index, const char *k);

() does the equivalent to t[k] = v, where t is the value at the given valid index and v is the value at the top of the stack.

This function pops the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event.

Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, Lua 5.1 Reference Manual.

The lua_setfield() manual page is based on Lua Reference Manual 5.1 and was created by Sergey Bronnikov.

July 15, 2022 Debian