Re: lua_compilestring()
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: lua_compilestring()
- From: Oscar Lazzarino <osk@...>
- Date: 2001年12月03日 15:33:00 +0100
Luiz Henrique de Figueiredo wrote:
>
> In 4.0, you can wrap you string inside "return function () XXX end",
> where "XXX" is your string.
> Run lua_dostring once on the extended string and then lua_call the result
> many times. (The result is left on the stack after lua_dostring.)
Please correct me if I'm wrong, but lua_call pops all the arguments AND
the function value from the stack. And so I must give the function a
name, in order to access it more than once...
Right now I'm using
"function userfunc() XXX end"
then lua_getglobal(LS, "userfunc"); lua_call(LS, 0, 0);
Oscar Lazzarino