Re: Storing Variable Properties
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Storing Variable Properties
- From: "Wim Couwenberg" <wcou@...>
- Date: 2004年1月13日 12:00:11 +0100
> Is there a way to set a flag or property on a lua variable such that
> when it gets modified a callback can be invoked?
In Lua `variables' are stored in tables. The Lua way to trap modifications
on a table is by using metamethods. You have to take some care because
write access (through __newindex) is only trapped for keys that are not yet
in the table, etc.
I would certainly try this `official' approach before diving into the Lua
sources. Write me if you need some hints.
--
Wim