-- Chapter 29 example: Animal and Dog. Add a Cat that inherits Animal.
local Animal = {}
Animal.__index = Animal
function Animal.new(name)
    return setmetatable({ name = name }, Animal)
end
function Animal:describe()
    print(self.name .. " is an animal.")
end

local Dog = setmetatable({}, { __index = Animal })
Dog.__index = Dog
function Dog.new(name) return setmetatable(Animal.new(name), Dog) end
function Dog:describe()
    Animal.describe(self)
    print("  ...specifically, a dog.")
end

Dog.new("Rex"):describe()
-- TODO: add a Cat class that inherits Animal, overrides describe to say
-- it is a cat, and adds a :meow() method. Make one cat and call both.
