A = {x = 10} B = {x = 20, y = 30} B.__index = B setmetatable(A, B) print(A.x, A.y)