lua-users home
lua-l archive

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

> one huge problem with string-based error messages is that 
> they're not well-defined enough to use properly as exceptions.

Lua actually does not use strings -- it uses numeric codes LUA_ERR*,
which are returned by lua_pcall and friends. Strings are there as
additional information.

But you're suggesting something else: that the programmer may raise
errors based on numeric codes. Lua actually already supports this: it
allows you to throw any value in a error: lua_error takes the value on
top of the stack and put it there when lua_pcall and friends return.