lua-users home
lua-l archive

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


On Sat, Nov 19, 2011 at 11:40 AM, Tony Finch <dot@dotat.at> wrote:
> So you don't have to write self repeatedly in methods, you can write:
>
>  function myclass.mymethod(_ENV, arg1, arg2)
>    slot1 = arg1 + arg2
>    slot2 = arg1 - arg2
>  end
>
> This requires you to import all the functions and modules you use into locals so they can be accessed as upvalues.

Also see [1] for some discussion on this.

[1] http://lua-users.org/lists/lua-l/2010-09/msg01061.html

-- 
- Patrick Donnelly