lua-users home
lua-l archive

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


On 07/01/2016 01:30 PM, Martin wrote:
On 16-06-30 05:11 PM, Tim Hill wrote:
What about {1, [3]=3, 2} ? {1, [2]=2, 2} ? etc

2 and 2. The largest implicit key. As I said, this is the *least* surprising, not that it has no surprises at all.
Huh. And what length of sequence should be after

local t = {1, [2]=2, 2}
table.remove(t, 2)
--print(t[2])
?

I think, better approach is to explicitly separate array part from hash
part. But then we need separate indexing method for array part. Maybe
syntax like "a.2" ?

If a.2 is anything else than a["2"], I would find it very confusing.
--
Thomas