title: Lua - How to pass object's function as parameter to another function
body: <pre><code>local a = {}
  function a:test1(value)
      print(value)
  end
  local b = {}
  function b:test2(v1, v2)
      v2(100);
  end
  b:test2(_, a.test1)
  </code></pre>
  
  <p>Doesn't work. Value is nil. I could find a solution doing an encapsulation in an anonymous function</p>
  
  <pre><code>b:test2(variable, function(value) a:test1(value) end)
  </code></pre>
  
  <p>But I find it pretty bad mkay</p>
  
  <p>What is the correct syntax ?</p>