lua
hjl750
这个作者很懒,什么都没留下…
展开
-
require使用
require "mod"mod.foo()-------------------local m=require "mod"m.foo()--------------------package.preload --预先加载的库表找不到找:loadfile loadlibfunction require(name)if not pa原创 2016-11-16 22:06:44 · 296 阅读 · 0 评论 -
环境
环境信息保存在全局变量table _G声明的全局变量,都在_G里value=loadstring("return "..varname) value=_G(varname) --效率高_G(varname)=value原创 2016-11-14 22:12:45 · 145 阅读 · 0 评论 -
线程
posix线程标准 pthread_t 类型未知,不一样实现不一样int pthread_equal(pthread_t,pthread_t)比较线程标识pthread_t pthread_self(void) / pid_t getpid() int pthread_create(pthread_t *thread,pthread_attr_t *attr,v原创 2016-10-30 22:52:16 · 130 阅读 · 0 评论 -
类
function account:new(o)o = o or {}setmetatable(o,self)self.__index=seifreturn oend原创 2016-11-19 00:29:16 · 158 阅读 · 0 评论