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)
冒號符號用於定義對例項方法的呼叫。