lua-users home
lua-l archive

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


Hi Luiz,

>> Would there be any downside to Lua's 'type()' returning the value of a
>> '__type' metamethod if its type is 'userdata'?
>> return t == "userdata" and mt and mt.__type or t

> Yes, it'd break all programs that rely on type returning "userdata"...

How so?  It would only break programs with userdata types that have a metamethod named "__type".  All others would continue to return "userdata".  Do many (any?) Lua programs make use of a __type metamethod?

Thanks,
Greg