RosettaCodeData/Task/Call-an-object-method/Lua/call-an-object-method-1.lua
Ingy döt Net 6f050a029e update
2013-06-05 21:47:54 +00:00

4 lines
147 B
Lua

local object = { name = "foo", func = function (self) print(self.name) end }
object:func() -- with : sugar
object.func(object) -- without : sugar