Sample code:

function Account:new (o)
  o = o or {}   -- create object if user does not provide one
  setmetatable(o, self)
  self.__index = self
  return o
end

taken from "Object-Oriented Programming: Classes" http://www.lua.org/pil/16.1.html

What is the purpose of the self.__index = self line? And why is it executed every time an object is created?

Edit
Report