lua-users home
lua-l archive

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


> 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?

Yes.


> 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.

-- Roberto