[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Tables, Metatables, Children, and Length
- From: Marc Lepage <mlepage@...>
- Date: Mon, 3 Dec 2012 20:44:36 -0500
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.
- Follow-Ups:
- Re: Tables, Metatables, Children, and Length, Coda Highland
- Re: Tables, Metatables, Children, and Length, Dirk Laurie
- Re: Tables, Metatables, Children, and Length, spir