[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: catching lua variable set and get value
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 25 Jun 2003 02:25:43 -0300
>I'd like to be able to intercept set/get of value to lua varibales.
Try the code below. Instead printing, call your C functions.
--lhf
do
local function set(t,name,value)
print("set",name,value)
end
local function get(t,name)
print("get",name)
return name
end
setmetatable(getfenv(),{__index=get,__newindex=set})
end
-- test it...
sym = 10
a = sym