lua-users home
lua-l archive

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


Example:

   tbl = {}
   setmetatable(tbl, {__index = function(t,k) print("test") end})
   tbl[1] = 1
   tbl[2] = 2

Prints nothing... ?? 

Also, is there any metamethod that you can hook to know when a value is being set?  I know there is __newindex but that only appears to be called for new values being inserted into the table.  I want to hook both cases of new values and also setting existing values.

--
// Chris