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)
- 3Please see stackoverflow.com/questions/4911186/…James Curtis– James Curtis2014-03-21 17:03:58 +00:00Commented Mar 21, 2014 at 17:03
- This is a duplicate, please close.Oliver– Oliver2014-03-21 21:25:02 +00:00Commented Mar 21, 2014 at 21:25
Add a comment |
2 Answers
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.