摘要: Lua 中 ipairs 与 pairs 功能的自定义实现 iparis local function myipairs(tbl) return function(state, control) -- iterator control = control + 1 local value = tbl[ 阅读全文
posted @ 2021-07-15 17:39 withpear 阅读(614) 评论(0) 推荐(0)
摘要: 值 在Lua中,只有值有类型,变量不需要定义类型; local a -- 无需定义类型 print(type(a)) -- nil 变量没有类型 print(type(10)) -- number 只有值有类型 而在C#中,值和变量都有类型。 int b; //变量要指明类型 Console.Wri 阅读全文
posted @ 2021-06-16 17:28 withpear 阅读(1084) 评论(0) 推荐(0)