lua lua_settable

703 ワード

void lua_settable (lua_State *L, int index);

Does the equivalent to  t[k] = v , where  t  is the value at the given index,  v  is the value at the top of the stack, and  k  is the value just below the top.
This function pops both the key and the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex"event (see §2.4).
 
lua_settableフロントスタックの場合
-----------------top-------------------`Val'1table-----------------end-------------------
 
lua_settable(L,-3)の後
-----------------top-------------------table-----------------end-------------------