lua-users home
lua-l archive

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


Hi, I have a table which has a metatable. I want to add children (other tables) to the metatable, not to the table directly.

If I do so, I can get at them by t[1], t[2], t[3] and so on.

But I can't do this:

for i = 1, #t do
    local child = t[i]
end

Because #t still returns 0.

Comments and feedback welcome.