object.__type
or is there anyway to add in so the following would work
local myObj = object:new() print( type( myObj ) )
would print something like say "object"
Posted 13 January 2013 - 01:53 AM
object.__type
local myObj = object:new() print( type( myObj ) )
Posted 13 January 2013 - 02:15 AM
local oldT=type type=function(param) if oldT(param)=="table" then local mt=getmetatable(param) if oldT(mt)=="table" and oldT(mt.__type)=="function" then return mt.__type(param) elseif oldT(mt)=="table" and mt.__type then return mt.__type end end return oldT(param) end
Edited by KaoS, 13 January 2013 - 02:26 AM.
Posted 13 January 2013 - 02:26 AM
KaoS, on 13 January 2013 - 02:15 AM, said:
local oldT=type type=function(param) if param and oldT(param)=="table" then local mt=getmetatable(param) if oldT(mt)=="table" and mt.__type and oldT(mt.__type)=="function" then return mt.__type(param) elseif oldT(mt)=="table" and mt.__type then return mt.__type end end return oldT(param) end
Posted 13 January 2013 - 02:28 AM
0 members, 1 guests, 0 anonymous users