[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: More lua stack operations support?
- From: Richard Hundt <richardhundt@...>
- Date: Mon, 03 Mar 2014 10:31:03 +0100
On 3/3/14 9:50 AM, Jean-Luc Jumpertz wrote:
> From my experience after writing 25K lines of code using intensively the Lua C API, actually lua_remove (range) would be a valuable addition.
Nah, you just need `lua_splice(L, stack_bot, nslots, repl_bot,
repl_nslots)`. Push, pop, shift, unshift, insert, and remove can all be
done with one function. In fact, the lua_pop, lua_remove, etc. could be
macros which call `lua_splice` ;)
Or put it in aux as `luaL_splice`.
I'm not sure if I'm actually serious, though. I'd have to try it and see
if I could keep the stack sane given such a chainsaw.