Re: static (class) variables
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: static (class) variables
- From: Jonathan Goble <jcgoble3@...>
- Date: 2015年11月22日 15:02:56 -0500
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.