lua-users home
lua-l archive

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


> Would there be any downside to Lua's 'type()' returning the value of a
> '__type' metamethod if its type is 'userdata'?

Yes, it'd break all programs that rely on type returning "userdata"...
One way out is to use __tostring instead of type.

But in your own program you can simply redefine type to do as you want.
--lhf