lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Thanks, that really helps.

在 2017年1月17日,下午10:12,云风 Cloud Wu <> 写道:

hz <>于2017年1月18日周三 下午1:43写道:
just a little inconvenient when used with: 

for k, v in pairs(obj) do … end

the keys in the realobj will be ignored. It's a known issue:

Why don't pairs() and ipairs() obey an __index metamethod

You can use __pairs metamethod like this :

__pairs = function(t) return next, realobj, nil end