lua-users home
lua-l archive

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


On 18 August 2015 at 13:51, Nan Xiao <xiaonan830818@gmail.com> wrote:
> Hi Daurnimator,
>
> "In this case I passed 'self' as the state parameter; which neatly
> lines up with the 'self' parameter required to the `next_foo` call."
>
> which neatly lines up with the 'last' parameter?

A function declaration with a colon: function foo:bar() end
adds a hidden `self` parameter. i.e. it is equivalent to: function
foo.bar(self) end