lua_setmetatable return type

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

lua_setmetatable return type

Daurnimator
lua_setmetatable is documented as returning void.
However the prototype returns int.
The implementation always returns 1.

Reply | Threaded
Open this post in threaded view
|

Re: lua_setmetatable return type

云风 Cloud Wu
The lua_setmetatable of lua 5.0 may returns 0 if the type can not have
a metatable. The document changed from  5.2.

Reply | Threaded
Open this post in threaded view
|

Re: lua_setmetatable return type

Roberto Ierusalimschy
In reply to this post by Daurnimator
> lua_setmetatable is documented as returning void.
> However the prototype returns int.
> The implementation always returns 1.

Thanks for the correction.

-- Roberto