lua-users home
lua-l archive

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


Hello,

I'm using something like this

mytab = {
   
    func1 = function(…) do something end
    func2 = function(…) do something other

}


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?
Thanks a lot

Phil