lua-users home
lua-l archive

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


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.

-R