💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 技巧1: ~~~ local a = {}; function b() print("Hello World") end a["sell"] = {callFunc =b} a["sell"].callFunc() ~~~ # ## 技巧2: 使用lua 自带的 unpack : 解释:把一直数组(只有连续数字下标的 table)展开成一串返回值,但是对用字符串或别的东西做 key 的 table 无能为力。 ~~~ function unpackex(tbl, args) local ret = {} for _,v in ipairs(args) do table.insert(ret, tbl[v]) end return unpack(ret) end print(unpackex({one = {"one", "two", "three"}, two = "T" , three = "TH"},{"one", "two", "three"})) ~~~ 输出:>>  table: 00ABC2D0TTH