Assuming I have a piece of code such as the following
aTable = {aValue=1}
aTable_mt = {}
print(aTable)
What must I do to make Lua print something like aTable current aValue = 1
as opposed to table: 0x01ab1d2
.
So far I've tried setting the __tostring
metamethod but that doesn't seem to be invoked by print
. Is there some metamethod I've been missing or does the answer have nothing to do with metamethods?