-- A structure is a table of fields
local size = {width = 0, height = 0}
size.width = 10
size.height = 10
local point = {top = 0, left = 0}
point.top = 5
point.left = 5
-- Tables nest: a field can hold another table
local rect = {size = size, point = point}
local left = rect.point.left
-- left = 5
local height = rect.size.height
-- height = 10
-- The same, written in one expression
local other = {
size = {width = 20, height = 20},
point = {top = 1, left = 1},
}
local width = other.size.width
-- width = 20
-- Set later: a new field appears on assignment
local later = {}
later.size = size
later.point = point
local top = later.point.top
-- top = 5
print("left = " .. left)
print("height = " .. height)
print("width = " .. width)
print("top = " .. top)