[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Docs for lua_remove, lua_replace
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 16 Feb 2022 15:13:09 -0300
> The documentation for `lua_remove` and `lua_replace` indicates that both
> will never trigger an error. However, their (macro) definitions use
> lua_pop, which *can* raise an error in Lua 5.4. Therefore, I believe
> that the function indicators should be `[-1, +0, e]` instead of
> `[-1, +0, –]`.
lua_pop can raise an error only when popping a to-be-closed slot.
According to the documentation, a to-be-closed slot should only
be removed by lua_pop or lua_settop; that is, 'lua_remove' and
'lua_replace' should not be used to remove a to-be-closed slot. So,
if the API is used followind the documentation, 'lua_remove' and
'lua_replace' cannot raise errors.
-- Roberto