At the moment, if I want to test: “Is v
- which could be anything - an instance of class V
?” then I do:
if type(v) == "table" and v.is_a and v:is_a(V) then
-- is what I want
else
-- is not
end
Is this the right/best way to do it? Is there anything I’ve missed here?
I’m doing this often enough that I’m going to wrap it up into a function so thought I’d ask before baking it.