lua-users home
lua-l archive

lua_tostring surprise

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


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

AltStyle によって変換されたページ (->オリジナル) /