lua-users home
lua-l archive

RE: Metamethod when removing an index from a table?

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


>> I can check for the metamethod and return to the original pairs etc
>> implementation pretty quickly...
>Or you can store the actual table in the proxy and make pairs and friends
>work on the actual table when handed a proxy. Easy to do in Lua and fast
>too.
Yes, that's more or less what I meant (the only way I know I've got a proxy
is to look for the metatable or metamethod). But checking for __next is more
general (allowing, e.g. tables where pairs() orders the keys)
P. 

AltStyle によって変換されたページ (->オリジナル) /