lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Nov 22, 2015 at 2:53 PM, Andreas Matthias
<andreas.matthias@gmail.com> wrote:
> Display:new() -->  Display.new(Display)  -->  self refers to Display
>
> dis1:getCount()  -->  dis1.getCount(dis1)  -->  self refers to dis1

Exactly. When you call a method with ":", the object on the left of
the colon becomes the first argument to the method, and thus the value
of the "self" argument.