lua-users home
lua-l archive

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


On Thu, Apr 26, 2012 at 7:37 AM, Markus Klotzbuecher
<markus.klotzbuecher@mech.kuleuven.be> wrote:
> Dear List,
>
> Is the following permitted:
>
> Calling from C into Lua (using pcall), which in turn calls a C
> function that then calls back into the same Lua (pcall again)?
>
> The only information I could find is the following (which suggests it
> is OK):
>
> http://article.gmane.org/gmane.comp.lang.lua.general/14661/match=recursive+pcall+lua

I can't see why not. I mean, that's actually fairly common -- a
program's main loop that invokes a Lua script to handle something,
with exposed C functions that may trigger metatables or function calls
on Lua objects in the state.

And in fact I do exactly that in my application.

/s/ Adam