lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Sun, Jul 1, 2012 at 5:13 PM, Dimitris Papavasiliou <> wrote:
> Thats really nice. It would be nice if the pretty printer could try calling
> __tostring' on  stuff it doesnt understand (c types) in the hope of getting
> a printable version.

It already does that, doesn't it?  Try this for example:

>  f = ("/usr/bin/lua")
>  f
file (0xc229f0)
>  f:close()

OK, they were LuaJIT cdata items, which it thinks are blank, and doesnt call __tostring or print cdata when it prints them in a table, only on their own:

>  w.inet6[1].addr
  addr = ,
  cacheinfo = ,
  ifaddr = ,
>  tostring(w.inet6[1].addr)
>  type(w.inet6[1].addr)
>  w.inet6[1].addr

It would be nice if it called __tostring for these.