|
Thanks. had implemented as this: -- setmetatable(obj, { __newindex = function (tab, k, v) print('setting: ' .. k .. ' -> ' .. tostring(v)) rawset(tab, k, v) end }) which will only trigger the first setting for a new key: self.data['foo'] = 'bar' self.data['foo'] = 'next-bar’ — any way, nice solution, thanks.
|