lua 闭包时间:2023-03-09 14:28:54 --匿名函数使用upvalue i保存他的计数, 闭包是一个函数加上它可以正确访问的upvalues function newCounter() local i = return function() i = i + return i end end c1 = newCounter() print(c1()) print(c1())