[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_CFunction equivalence
- From: Duncan Cross <duncan.cross@...>
- Date: Fri, 26 Jul 2013 08:14:50 +0100
On Fri, Jul 26, 2013 at 4:34 AM, William Ahern
<william@25thandclement.com> 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?
>
>
Only since Lua 5.2, which introduced the concept of "light C
functions" for specfically this case of C functions with no upvalues.
-Duncan