lua脚本, test()函数中调用A:new, o的内存空间还是当前的self。不会重新创建一个table么
A = {}
function A:new()
self._value = 0
end
fuction A:test()
local o = A:new() -- o的内存空间还是当前的table
end
怎么样才能A:new出不同的table空间
...全文
1531打赏收藏
LUA脚本,面向对象问题 new的table问题
lua脚本, test()函数中调用A:new, o的内存空间还是当前的self。不会重新创建一个table么 A = {} function A:new() self._value = 0 end fuction A:test() local o = A:new() -- o的内存空间还是当前的table end 怎么样才能A:new出不同的table空间