1 Star 0 Fork 3

Fsj_wade/lua

forked from fulinux/lua 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
closure2.lua 246 Bytes
一键复制 编辑 原始数据 按行查看 历史
fulinux 提交于 2015-09-22 16:26 +08:00 . add some files
#!/usr/bin/lua
function newCounter()
local i = 0
func = function()
i = i + 1
return i
end
return func
end
c = newCounter()
print(c())
print(c())
c1 = newCounter()
print(c1())
print(c1())
print(c())
print(c1())
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Lua
1
https://gitee.com/fsj2001/lua.git
git@gitee.com:fsj2001/lua.git
fsj2001
lua
lua
master

搜索帮助