[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: function call in table with reference
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 23 Aug 2013 07:48:31 -0300
> I can call the functions with mytab.func1(), but I would like to use a reference to the table itself (like the self parameter on Python classes):
> mytab = {
> func1 = function(self, ?) do something end
> func2 = function(self, ?) do something other
> }
>
> and self should be point to mytab. How can I do this?
Your solution using self works fine. Just call the function with mytab:func1().