
lua
hard_man
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
lua的table+setfenv+setmetatable陷阱
--file1.lua x = funciton() print("this is x") end ------------- --file2.lua local t = {} local _G = _G setfenv(1,t) --设置了这个之后,只要是在本文件中对未声明变量的访问,全部会导致递归。 _G.setmetatable(t, { __index = f原创 2013-01-11 19:47:36 · 4274 阅读 · 0 评论 -
lua5.2调用c函数成功的例子
1. main.c ----------------- //动态库 #include #include #include #ifdef _cplusplus extern "C"{ #endif #include #include #include static void checktoptype(lua_State *L){ if(l原创 2013-01-16 11:07:24 · 2695 阅读 · 0 评论