Lua 编程/冒号
外观
< Lua 编程
-- These two statements are equivalent function a.b:c (params) body end a.b.c = function (self, params) body end
-- By using a colon operator, the name of the object does not need to be passed as a first argument myobj:foo(n) -- equivalent to myobj.foo(myobj, n)
冒号符号用于定义对实例方法的调用。