[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LUSH, a Lua network over Udp for Server-Host applications
- From: Wim Couwenberg <debosberg@...>
- Date: Fri, 20 Feb 2004 01:21:19 -0800 (PST)
> 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