lua-users home
lua-l archive

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


On 10/05/16 15:31, Luiz Henrique de Figueiredo wrote:
> For a tool, see http://lua-users.org/lists/lua-l/2012-12/msg00397.html .

Huh, just ran this over some code and spotted a mistake of the form:

  local function foo()
    return 1, 2, 3, 4
  end

  local a, b c, d = foo()

a) Thanks for saving me some head scratching

b) Would it be viable to make such a form a compile error? Is there any
example of that code being what the writer wanted? Would just requiring
that any line starting with `local` is either terminated cleanly ('\n',
';') or followed by an assignment?

I expect there would be problems supporting...

  local a,b
        ,c,d = foo()

...and similar, so I'm not getting my hopes up :)

Scott