lua-users home
lua-l archive

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


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

Attachment: pgp_Sj80e_ix2.pgp
Description: PGP signature