get the address of a lua object
Here's a hokey way to do it:
Pair.__tostringx = function (p)
Pair.__tostring = nil
local s = "Pair " .. tostring(p)
Pair.__tostring = Pair.__tostringx
return s
end
Pair.__tostring = Pair.__tostringx
> print(p)
Pair table: 0x7fe469c1f900
You can do more string manipulation inside Pair.__tostringx
to get the format you want, e.g., to remove "table".