From 864c96f36ce8410b03652b1cb9800e4b3c76bcf7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 13 Jun 2002 10:39:55 -0300 Subject: new fallback for equality `__eq' --- lbaselib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 83e8061d..6105af56 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.78 2002/06/05 17:24:04 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.79 2002/06/06 12:39:48 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -115,6 +115,15 @@ static int luaB_globals (lua_State *L) { return 1; } + +static int luaB_rawequal (lua_State *L) { + luaL_check_any(L, 1); + luaL_check_any(L, 2); + lua_pushboolean(L, lua_rawequal(L, 1, 2)); + return 1; +} + + static int luaB_rawget (lua_State *L) { luaL_check_type(L, 1, LUA_TTABLE); luaL_check_any(L, 2); @@ -400,6 +409,7 @@ static const luaL_reg base_funcs[] = { {"type", luaB_type}, {"assert", luaB_assert}, {"unpack", luaB_unpack}, + {"rawequal", luaB_rawequal}, {"rawget", luaB_rawget}, {"rawset", luaB_rawset}, {"pcall", luaB_pcall}, -- cgit v1.2.3-55-g6feb