[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Named function in a table
- From: starwing <weasley.wx@...>
- Date: Mon, 6 Dec 2010 10:41:07 +0800
hi all, I have a idea about named function in a table constructor.
we know, function foobar()...end is just a semantics sugar of foobar = function()...end -- in mostly (not all) scene.
because in a table constructor, we can not write:
{
function OnClick(evt)
print("we are clicked")
end
}
normally, it should be just the semantics sugar of:
{
_OnClick_ = function(evt) print("we are clicked") end
}
but now (in Lua 5.1.4), we can only get:
'(' expected near 'OnClick'
should we add this sugar into lparser.c?