lua_tostring surprise

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

lua_tostring surprise

John Belmonte
Today I was surprised to find that while base lib tostring honors the
metatable __tostring field, lua_tostring in the C API doesn't
(lua-5.1-rc).  This renders __tostring mostly useless.

More immediately, it would be nice if report() in lua.c attempted to
call tostring via Lua in order to honor __tostring.  I'd like to use
tables as exception objects, but still have them print a nice message
when one goes unhandled.

--John