lua-users home
lua-l archive

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


Since the local scope does not have table semantics where it is indexable by an evaluation:
local [getname()] = 3

why not disrequire the use of the 'function' keyword when 'local' is present?

local function success(items, total)
  reply(client, view.list(items, total))
end

local success(items, total)
  reply(client, view.list(items, total))
end

It shouldn't break compatibility with anything. It's basically just the removal of additional implicit syntax.
'local' implies initialization\definition and bars evaluation. '()' only appears in function declarations outside of evaluations.
When the two appear together there is only one possibility.