[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Stack politeness
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 24 Jul 2002 12:13:48 -0300
> 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