Log In  


I don't know if this is expected behavior, but I thought I should ask:

Is it expected that stringifying the table var/ref will give different results when it has a (blank?) metatable attached?

4


It is not -- Fixed for 0.2.4c

This is Lua's standard tostring() output for tables, that is used when the table has a metatable AND __tostring is set on that table (that last condition was missing).


(The only reason for using a customised tostring() for printing tables was just that those hex address strings are usually not of interest and super ugly in 128x128, heh)


unless we could poke these addresses 😜


I tried going down that rabbithole for Picotron, and it's not pretty!

Or at least, I couldn't find a nice way to make it work.


Addresses at least let us check if some table is the same as another one. That is useful when you don’t have other means of debugging yet (like custom tostr function).


2

You can still get the address with tostr(tbl,1) (it's not very obvious -- I should add some examples to the manual)

> ?tostr(print,1)
function: 0x2b31195c
> ?tostr({},1)
table: 0x80e5d9c
> ?tostr({},1)
table: 0x80efa3c


[Please log in to post a comment]