For debugging outputs I have occasionally wanted to ask a variable its name. I don't know a direct way to do this but I notice that the type of the values given to __index are a table and a string.
How are you accessing a variable if not by name?
The only case I can think of is getting it from debug.getlocal, which returns `name,value`