local a = {}
local b = {}
a.init = function()
a.b = b
a.b.test(a)
b.init(a)
end
a.test = function()
print("this is a")
end
b.init = function (a)
b.a = a
b.a.test()
end
b.test = function (a)
a.test()
end
a.init()
比如A类文件太长,那么新建一个B类,大部分代码写在B里面,用A去调用B的函数。