lua-users home
lua-l archive

Re: Easier function declaration in tables for 5.2?

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


I'd like that too - normally I make the mod myself. I tend to also add @ as self. (or self: for function calls) as I get tired of writing self all the time...
ie:
Rectangle = {
 function IsSquare()
 return @width == @height
 end
}
but I don't think the authors like such amounts of sugar with their language ;).
Is it possible that 5.2 could allow syntax like:
table={
function hello(self)
 doStuff(self)
end,
hi=6
}

AltStyle によって変換されたページ (->オリジナル) /