lua-users home
lua-l archive

Re: protecting a variable

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


Alex Queiroz wrote:
Hallo,
On 3/14/06, Noel Frankinet <nfr@gistek.net> wrote:
Hello,
Is there a way to protect a variable like in tcl ("trace") ?
That is, how to call c or lua code whenever a lua variable is accessed
(read or write).
 If the variable is global you can use the __index and __newindex
metamethods, for each global variable belongs to a table (_G in the
most common case).
--
-alex
http://www.ventonegro.org/
Hello Alex,
Thank you for you answer but,
what are __index, __newindex, _G and how do I access them (from C).
Is there a doc or tutorial somewhere ?
Thank you
--
Noël Frankinet
Gistek Software SA
http://www.gistek.net

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