[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thoughts on optional commas
- From: Greg <tghill@...>
- Date: Sat, 3 Mar 2012 15:10:54 +0000 (UTC)
> 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