[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Feature Request: type() consult __type for userdata
- From: "Greg Fitzgerald" <garious@...>
- Date: Fri, 18 Jan 2008 21:14:47 -0800
>> 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?