码迷,mamicode.com
首页 > 其他好文 > 详细

lua lua_settable

时间:2018-04-29 20:35:10      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:oid   UI   stat   event   new   method   for   pre   htm   

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‘
1
table
-----------------end-------------------

 

lua_settable(L, -3) 之后


-----------------top-------------------
table
-----------------end-------------------

lua lua_settable

标签:oid   UI   stat   event   new   method   for   pre   htm   

原文地址:https://www.cnblogs.com/zhangdongsheng/p/8971717.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!