lua-users home
lua-l archive

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


Milano Carvalho wrote:
> 
> x = {v = 0}
> setmetatable(x, {__settable = function() print("settable") end})
> x.v = 10
> 
> It doesn't print nothing.
> 
> I'm doing something wrong or is it a bug?

It seems you are right and 5.0-alpha does not use settable and
gettable on real tables any more (it's even documented).

I consider it a bug.

Ciao, ET.


PS: Looking at luaV_[sg]ettable, the interpretation of the different
types of table metamethods (table/function/...) is IMHO a little
bit strange anyway...