lua-users home
lua-l archive

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


>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