摘要: --匿名函数使用upvalue i保存他的计数, 闭包是一个函数加上它可以正确访问的upvalues function newCounter() local i = 0 return function() i = i + 1 return i end end c1 = newCounter() print(c1()) print(c1()... 阅读全文
posted @ 2016-09-19 00:05 zzyoucan 阅读(131) 评论(0) 推荐(0) 编辑