1

In some calling of function we use "." operator while in some we use ":" what is the difference between them. Example:storyboard:addEventLsitener(something,something) graphics.newImageSheet(something,something)

2

2 Answers 2

5

foo:bar(...) is syntactic sugar for foo.bar(foo, ...), i. e. that's the "traditional" object-oriented syntax. The . operator only accesses a member of a table as normal, without doing anything special when used in conjunction with a function call, whereas : sets the self argument of the called function.

Sign up to request clarification or add additional context in comments.

Comments

2

storyboard:addEventLsitener(a,b) is sugar for storyboard.addEventLsitener(storyboard,a,b).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.