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)

Javasamurai
  • 666
  • 7
  • 21

2 Answers2

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.

user3447428
  • 125
  • 4
2

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

lhf
  • 70,581
  • 9
  • 108
  • 149