[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: __assign
- From: "Aaron Brown" <aaron-lua@...>
- Date: Mon, 14 Jun 2004 11:01:58 -0400
Dan East wrote:
> Is there some non-trivial implementation issue that
> prevents an __assign metatable event within Lua? Or is
> there some other mechanism already providing the same
It can currently be done with __newindex and a proxy table.
I don't see this explained in the wiki anywhere, but it is
on page 115 of Programming in Lua, if you have it.
Briefly, the idea is that the table the user assigns to is
always empty -- its __newindex metamethod does any
housekeeping you want done on every assignment, plus the
actual assignment to the real table (which the user never