lua-users home
lua-l archive

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


> I think I read something about potential ambiguities with the function
> call without parenthesis on the list some time ago, but I don't
> remember exacly the issue.

Consider this:

a = b
"xxxxx":foo()

and this:

a = b"xxxxx":foo()


For the parenthesis case Lua has a dirty hack:

> do
>> a = f
>> ("xxxxx"):foo()
stdin:3: ambiguous syntax (function call x new statement) near '('

That is, you cannot break a line between a function identifier and
the open parenthesis. (If you want a new statement, you must use a
semicolon.)

We prefer not to extend the hack (and the dirt) to other cases.

-- Roberto