lua-users home
lua-l archive

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


> Unfortunately it would introduce ambiguities. Lua supports a mix of
> key-value table syntax and array-style table syntax, and also supports
> optional parentheses in function calls when calling with a single
> string or table literal parameter. So for example, if
> commas/semicolons between table fields were optional, {a = b "test"}
> could be either {a = b; [1] = "test"} or {a = b("test")}. There are
> probably other ambiguities too.

I agree that it is unfortunate.  It seems sad to miss an opportunity to simplify
a language to accommodate an obscure part of the syntax.  

Personally I'd be in favor of dropping the option of no parentheses from
function calls if I could drop all commas from the language.  This would break
compatibility with existing code but the fix would be trivial.

I wonder if there are any other ambiguities? 

- Greg