Re: calling from C to Lua to C and back to Lua?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: calling from C to Lua to C and back to Lua?
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2012年4月26日 12:14:56 -0300
> Calling from C into Lua (using pcall), which in turn calls a C
> function that then calls back into the same Lua (pcall again)?
Yes. This is quite common in Lua. For instance:
table.sort(t, function (a,b) return a.x < b.x end)
When you run this script, the stand-alone C interpreter calls Lua (to
run the main chunk) that calls C (table.sort) which calls Lua
(the user-provided order function).
-- Roberto