lua-users home
lua-l archive

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


> When making C functions to expose to Lua, what guidelines should the 
> function adhere to in terms of the state of the stack upon return? Of 
> course, the return values need to be at the top, and equal to the integral 
> return value of the function, but what about arguments to the function? 
> Must they be removed? preserved? does Lua not care?

Lua does not care. Actually, that's why the function must return its
number of results. Otherwise, Lua could just assume that everything on
the stack were results, or else that everything minus the arguments were
results.

-- Roberto