Re: how to transfer Lua Function and function params between different Lua state?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: how to transfer Lua Function and function params between different Lua state?
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2012年11月25日 12:18:51 -0200
> I want to write a C module,when Lua call this module's spawn function,it
> create a new Lua state,and the new Lua state can call its Lua function,like
> this:
>
> require("qnode")
>
> function test(a)
> print("in test")
> print(a)
> end
>
> qnode.spawn(test, 100)
>
> but,when i review the Lua C API,seems there is no function to get the Lua
> function from the Lua stack.
> So,how can I achieve this purpose?
I am not sure I understood your question, but have you looked at
'string.dump'?
-- Roberto