first (parcial) implementation of 'keyin'/'removekey'

(still no metamethods, no raw verssions)
This commit is contained in:
Roberto Ierusalimschy
2018-02-25 09:48:16 -03:00
parent f055a9dffd
commit d766e2ae17
5 changed files with 98 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lobject.h,v 2.136 2018/02/22 17:28:10 roberto Exp roberto $
** $Id: lobject.h,v 2.137 2018/02/23 13:13:31 roberto Exp roberto $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@@ -156,13 +156,20 @@ typedef StackValue *StkId; /* index to stack elements */
#define LUA_TEMPTY (LUA_TNIL | (1 << 4))
#define ttisnilorempty(v) checktype((v), LUA_TNIL)
/*
** By default, entries with any kind of nil are considered empty
*/
#define isempty(v) ttisnilorempty(v)
#define isreallyempty(v) checktag((v), LUA_TEMPTY)
#if defined(LUA_NILINTABLE)
#define isempty(v) isreallyempty(v)
#else /* By default, entries with any kind of nil are considered empty */
#define isempty(v) ttisnilorempty(v)
#endif
/* macro defining an empty value */
#define EMPTYCONSTANT {NULL}, LUA_TEMPTY