LUA返回的是引用

local t1= {10,11}
function t1.Show()
    print("t1 show")
end
function GetT() return t1 end


local t2 = GetT()


t2[1] = 5 --修改t2会同步修改t1
print(t1[1])


t1[1] = 55 --修改t1会同步修改t2
print(t2[1])

t1 = nil
print(t2[1]) ----将t1置nil 为什么不会影响t2 
原文地址:https://www.cnblogs.com/zhangdongsheng/p/8126275.html