local generic_func = function(table, x) return table.pos + x end local obj = { pos = 1} local unrelated = { pos = "42" } function obj:func1(x) return self.pos + x end function obj.func2(object, x) return object.pos+x end obj.func3 = generic_func -- identical results, no matter how you call it print(obj:func1(2)) print(obj.func1(obj, 2)) print(obj:func2(2)) print(obj.func2(obj, 2)) print(obj:func3(2)) print(obj.func3(obj, 2)) print(generic_func(obj, 2)) -- function from "obj" runs on unrelated table print(obj.func1(unrelated, 2))