07 2017 档案

摘要:-- create class Account = {balance = 0} -- construct function Account:new(o) o = o or {} setmetatable(o,self) self.__index = self return o end function Account:deposit(v) ... 阅读全文
posted @ 2017-07-18 15:27 hao.ma 阅读(1647) 评论(0) 推荐(0)
摘要:?;?.lua;/usr/ect/?;/usr/local/lua/?/?.lua require 'demo" demo demo.lua /usr/etc/demo /usr/local/lua/demo/demo.lua 匹配的时候Lua会首先将问好用虚文件名替换, 然后看是否有这样的文件存在, 如果不存在继续用同样的方法用第二个模式匹配 阅读全文
posted @ 2017-07-12 11:34 hao.ma 阅读(166) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/whiteyun/archive/2009/08/10/1543139.html 阅读全文
posted @ 2017-07-10 13:12 hao.ma 阅读(156) 评论(0) 推荐(0)
摘要:-- print all values of array 'a' for i,v in ipairs(a) do print(v) end -- print all keys of table 't' for k in pairs(t) do print(k) end function newCounter() local i = 0 return f... 阅读全文
posted @ 2017-07-08 23:41 hao.ma 阅读(115) 评论(0) 推荐(0)