lua-users home
lua-l archive

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


On 19 April 2016 at 11:58, Ulrich Schmidt <u.sch.zw@gmx.de> wrote:
> Would it be possible to implement a shortcut usable inside class
> methods, so i can write
>   :method instead classname:method
> and
>   .field instead classname.field.

just use a shorter variable name as an alias:

---------- myverylongclassname.lua -----

local MyVeryLongClassname = class(....)
local C = MyVeryLongClassname

function C:method(...)
   .....
end

C.field = xxxxxx

....

return MyVeryLongClassname
------------------------------------------



-- 
Javier