lua-users home
lua-l archive

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

>Is there a clean way for finding out if the program is already in pcall?

No, but there is an easy way to make sure that you're always are in some
pcall: start your Lua interaction with a lua_pcall. :-)

Lua 5.0 will bring lua_cpcall that does the same as lua_pcall but for a
C function. This is how the standalone interpreter is now implemented.

Of course, there are times when you do want lua_pcall, eg when loading code
and testing for syntax errors or when running code and testing for execution