悉野小楼

导航

2024年5月24日

lua打印调用的函数文件及行数

摘要: lua根据调用堆栈可以打印调谁调用了我 string.split = function(s, delim) local split = {} local pattern = "[^" .. delim .. "]+" string.gsub(s, pattern, function(v) table 阅读全文

posted @ 2024-05-24 15:10 悉野 阅读(5) 评论(0) 推荐(0) 编辑

lua 写一个类

摘要: lua的创建类, 自定义class -- lua面向对象扩展 local _class={} function class(super) local class_type={} class_type.ctor=false class_type.super=super class_type.new=f 阅读全文

posted @ 2024-05-24 14:49 悉野 阅读(20) 评论(0) 推荐(0) 编辑

lua string扩展

摘要: lua string常用附加函数 string.split = function(s, delim) local split = {} local pattern = "[^" .. delim .. "]+" string.gsub(s, pattern, function(v) table.in 阅读全文

posted @ 2024-05-24 14:13 悉野 阅读(3) 评论(0) 推荐(0) 编辑