lua-users home
lua-l archive

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


On 2020-07-23 7:01 p.m., Philippe Verdy wrote:
As well I consider that the documented syntax of table constructors, where explicit keys can be arbitrary expressions whose value is unpredictable, such as a function call, is fundamentally flawed if the behavior and notably the order of assignments, is not defined at all. Thus syntax serves no serious purpose

I would say the same with the unary operator # which can return anything, as well as the corel ibrary function table.maxn()....

It's off-topic but I think array-table dualism can be fixed by adding syntax for indexing array part. Parenthesis for example. So for "t = {false, [1] = true}", "t[1]" is true and "t(1)" is false.

-- Martin