lua-users home
lua-l archive

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


Javier,

I'm working with Lua 3.1 (as mentioned in the original email's title), and the Lua 3.1 manual does not contain the below functions.

Cyril.

On 20-May-06, at 12:42 PM, Javier Guerra wrote:

On Saturday 20 May 2006 11:25 am, Cyril Zorin wrote:
Hi,

What's an idiomatic way to compare two lua_Objects in C? I'm guessing

from the manual (3.4 - Querying the Stack):

The API also contains functions to compare two values in the stack:

       int lua_equal    (lua_State *L, int index1, int index2);
       int lua_rawequal (lua_State *L, int index1, int index2);
       int lua_lessthan (lua_State *L, int index1, int index2);

lua_equal and lua_lessthan are equivalent to their counterparts in Lua (see 2.5.2). lua_rawequal compares the values for primitive equality, without metamethods. These functions return 0 (false) if any of the indices are
non-valid.

--
Javier