1 2 3 4 5 6 7 8 9 10 11
local t = {11,12,13, ['methods']={7, 8, 9}} function t.methods.foo(a,b) print(a+b) end function t.methods:bar(a,b) print(self[1]+self[2]+a+b) end t.methods.foo(100, 200) t.methods:bar(100, 200) t.methods.bar(t, 100, 200)