[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_CFunction equivalence
- From: William Ahern <william@...>
- Date: Thu, 25 Jul 2013 20:45:15 -0700
On Thu, Jul 25, 2013 at 08:34:35PM -0700, William Ahern wrote:
> If I do
>
> lua_pushcfunction(L, &foo);
> lua_pushcfunction(L, &foo);
>
> rc = lua_equal(L, -1, -2);
>
> is the value of `rc' guaranteed to be 1 in Lua 5.1, Lua 5.2, and LuaJIT?
> That is, is it part of the language that C functions without upvalues are
> compared according to their C function pointer values?
>
D'uh. The answer is no. I abstained from checking with actual code because I
assumed it would work, but my assumption was wrong, at least for Lua 5.1.