Lua has a really nice no-parenthesis call syntax that coupled with function closures allow me to write the following
local tag = 1
function test(obj)
return
function(str)
return
function (tbl)
tbl.objtag = tag
tbl.objname = str
return tbl
end
end
end
test (tag) "def"
{
}
test tag "def" --error
{
}
However, if I remove the parenthesis around (tag), it results in a compile error. So why does Lua allow no-parenthesis parameters (i.e. "def") and not no-parenthesis var (table in this case) parameters?