lua-users home
lua-l archive

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


I used to create tables of constants in Lua 4 that after having been created and filled initially wouldn't allow changing existing or adding more values to such tables. As far as I can see from my tests with Lua 5 the meta-methods for table access are reduced to work with non-existent keys only. 

Q1. Is this the intention of current design?

This effectively prevents me from intercepting attempts to change values of existing table keys by means similar to those of Lua 4. 

Q2. What would be the recommended way of doing something like in Lua 5?
Q3. Is there any way to intercept simple table key access on 'get' and 'set' even on existing keys in Lua 5?

Thank you,

Alex