[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: clarifying refman when Lua API functions raise errors
- From: roberto@... (Roberto Ierusalimschy)
- Date: Sun, 11 Nov 2007 09:57:29 -0200
> As far as I see, lua_next only raises an error if the key is invalid.
> Am I right that that traversing a table by starting with nil and not
> making any modification to the table (like in the example given in the
> description of lua_next) ensures the key is valid so that the function
> does not raise an error?
> lua_gc is a more complicated function, but initially I don't see it
> raising an error. Would that be if __gc raised? (which by convention
> it should not).
Yes, a call to lua_gc may trigger a __gc metamethod that should not,
but can, raise an error.
> luaL_getmetafield is defined in terms of six API functions. The only
> one that raises an error is lua_pushstring, and it is a memory error
> (type m).
The manual is wrong here. Thanks.