lua-users home
lua-l archive

Re: How to write function x:y():f() ... end ?

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


On Feb 28, 2013, at 2:57 AM, Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
> BTW, not every L-value can be used in function definition.
> The following code will give compilation error:
> 
> local t = {}
> function t[1] ()
> end
Perhaps you mean:
local t = {}
t[1] = function() end
Which is a perfectly fine syntax.

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