Created
October 6, 2012 21:07
-
-
Save cheald/3846132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local foo = {} | |
function foo:Bar(text) | |
-- `self` is foo, `text` is the passed in parameter | |
end | |
foo.Bar(foo, "text") | |
foo:Bar("text") | |
local otherFoo = {} | |
-- In this invocation, "self" will be otherFoo in the method | |
foo.Bar(otherFoo, "text") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment