[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Nested table constructor with reference to other children
- From: Marc Balmer <marc@...>
- Date: Sun, 30 Oct 2011 15:39:38 +0100
Hi
I am trying create a table with subtables, where subtables reference
each other, using the table constructor syntax:
a = {
one = {
a = 1,
b = 2
},
two = {
a = 1,
b = one -- set's b to nil
}
}
Is there a way to write this constructor, so that a.two.b is set to
a.one instead of nil? Or do I have to fixup the table after construction?
Thanks,
Marc