lua-users home
lua-l archive

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

> If you think about Lua 6, one goal will be to support real exceptions
> and exception handlers in the language (i.e. try..catch, and possibly
> finally using the new "toclose" semantics supported in the VM).

As far as I know, the reason why Lua uses pcall instead of try-catch
blocks has more to do with the Lua-C API than it has to do with types.
The pcall function can be easily exposed to C, but there is no obvious
way to do the same with try-catch blocks.

I believe this is also the main motivation for to-be-closed variables
instead of try-finally blocks.