lua-users home
lua-l archive

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


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