lua-users home
lua-l archive

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


> 1.) The 'Master' table sends out changes when its
> keys are assigned. Would 
> that be the 'newindex' metatable entry?
> 
> 2.) The 'Shadow' table cannot be edited (no key
> assignments). Could that be 
> done with the 'newindex' metatable entry?

That's a "yes" to both.  Be aware that __newindex is
only called if a *non-existing* key is assigned.  To
trap all key assignments use the "proxy" technique,
discussed many times before on this list (search in
the archives at www.lua-users.org)  Basically, you
redirect all key assignment/access through an empty
proxy table with both __index and __newindex
metamethods in place.

This proxy approach is not without its own troubles
unfortunately (e.g. table iteration becomes a bit
obscure)

--
Wim


__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools