title: How can I get a function's name by its pointer in Lua?
body: <p>In Lua I've created a pretty printer for my tables/objects.  However, when a function is displayed, it's shown as a pointer.</p>
  
  <p>I've been reading up on <a href="http://www.lua.org/pil/23.1.html" rel="nofollow">Lua Introspection</a> but when I introspect the function with <code>debug.getinfo()</code> it won't return the function's name.  This seems to be due to a scoping issue but I'm not sure how to get around it.</p>
  
  <p>What is the best way to get a function's name using its pointer?  (I understand functions are first class citizens in Lua and that they can be created anonymously, that's fine)</p>