[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug (?) in lua_setmetatable
- From: "Jim Whitehead II" <jnwhiteh@...>
- Date: Thu, 25 Oct 2007 15:57:13 +0100
> the lua_setmetatable() function returns an int, which is used in one
> other place in the Lua source; the return value is however always 1.
>
> Is the "always return 1" a bug in lua_setmetable()? Is the non-void
> return value the bug? ...
The 1 indicates that there is a single value on the stack, namely the
table that was passed in as the first argument. This allows for the
following:
local obj = setmetatable({}, mt)
As far as I am aware.