I quickly had to debug something, and wrote following function:
function dumpTable(t)
for i,v in pairs(t) do
if type(v) == "table" then
dumpTable(v)
else
print(i..":", v)
end
end
end
Now, for some reason
dumpTable({[1]="hello??", [2]="two", {[132]="something", [3.2]="else"}})
outputs
132: something
3.2: else
2: two
notice how the first string is missing? But if I change its key..
dumpTable({["one"]="hello??", [2]="two", {[132]="something", [3.2]="else"}})
it outputs
132: something
3.2: else
one: hello??
2: two
This is so unintuitive I almost feel like making an idiot of myself not seeing the mistake..
(btw. I do know that my function will overflow the stack if the table contains a recursive reference, going to fix that later)