title: What's difference between "t1.__index = t2" and "setmetatable(t1, {__index = t2})"?
body: <p>I seen this things in others code, and if I understood correctly it should be used like this:</p>
  
  <pre><code>t1 = {}
  t1.__index = t2 --1
  
  function t1:new()
      local new = {}
      setmetatable(new, {__index = t1}) --2
  
      new.something = 0
  
      return new
  end
  </code></pre>
  
  <p>But what they really do and why have different way of writing?</p>