[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature Request: type() consult __type for userdata
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 18 Jan 2008 22:49:08 -0200
> 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