lua-users home
lua-l archive

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


> - do I use blocks (the code in the function can get large and use a whole
>   pile of Lua calls)

You should not use blocks in code like that. Every function called by Lua
is automatically enclosed in a block. Usually, you need to use explicit
blocks only when C calls Lua in a loop, because then results can accumulate
and eventually the stack may fill up.

> - if I use them, since lua_endblock empties the stack, should I put it
>   before the lua_pushnumber call (or any call that pushes, but could
>   call Lua to do so) ?

*If* you use them, then you must put any push for results after the last
endblock.

-- Roberto