|
wouldn't it be much better to do something like this?
local _mt = {
__eq = function(a,b) return a.url == b.url end,
}
function constructor(url)
.......
return setmetatable({}, _mt)
end
here the metatable is defined once and used for every object. you
could also use it as a 'class test', by comparing it:
getmetatable(obj)==knownmetatable
at least, i guess it could eliminate Andrew's problem