[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Re-calling lua_loadbuffer
- From: Luiz Henrique de Figueiredo <lhf@<a href="/cgi-bin/echo.cgi?tecgraf.puc-rio.br">...</a>>
- Date: Sun, 10 Feb 2002 22:09:36 -0200
>I have changed my lua v4.0 so I can use lua_loadbuffer (was parse_buffer).
>What happens if I call this function, change the script in the passed
>buffer, and then call it again? Is that allowed?
Yes, it's allowed. Every time you call lua_loadbuffer, a new function
corresponding to the compiled script in the buffer is left on the stack.
>Would then calling lua_dobuffer do the second loaded scipt, or not?
After lua_loadbuffer you want to call lua_call not lua_dobuffer.
lua_dobuffer is essentially lua_loadbuffer followed by lua_call: