lua-users home
lua-l archive

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


2013/2/21 Marc Lepage <mlepage@antimeta.com>:

> My question is whether it might be better, in cases like this, to set the
> top of the stack before adding more stuff. So we have just value, then
> morestuff.

Two related queries.

1. If you fail to checkstack and the function's error handling is
    classified as '-', this may cause low-level errors (segmentation
    etc) not caught by Lua, right?

2. I've written a vararg function which builds up a lot of stuff
    on top of the vararg, but the vararg itself is not returned.
    There seems not to be a cheap API function for removing
    contiguous buried items, you have to do it one at a time.
    That's O(n^2) if the number 'n' of items to remove is the
    same the depth to which they are buried. Is it in any way
    perilous just to leave them there?