diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-25 09:48:16 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-25 09:48:16 -0300 |
commit | d766e2ae175495da85714d00e61d76174c5acc5b (patch) | |
tree | afc32a0787e57b2d6807b6e23bdd0a3cedf30945 /lobject.h | |
parent | f055a9dffd9ba403a99266a662b9992bc89dcaa1 (diff) | |
download | lua-d766e2ae175495da85714d00e61d76174c5acc5b.tar.gz lua-d766e2ae175495da85714d00e61d76174c5acc5b.tar.bz2 lua-d766e2ae175495da85714d00e61d76174c5acc5b.zip |
first (parcial) implementation of 'keyin'/'removekey'
(still no metamethods, no raw verssions)
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.136 2018/02/22 17:28:10 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.137 2018/02/23 13:13:31 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -156,13 +156,20 @@ typedef StackValue *StkId; /* index to stack elements */ | |||
156 | #define LUA_TEMPTY (LUA_TNIL | (1 << 4)) | 156 | #define LUA_TEMPTY (LUA_TNIL | (1 << 4)) |
157 | 157 | ||
158 | #define ttisnilorempty(v) checktype((v), LUA_TNIL) | 158 | #define ttisnilorempty(v) checktype((v), LUA_TNIL) |
159 | /* | ||
160 | ** By default, entries with any kind of nil are considered empty | ||
161 | */ | ||
162 | #define isempty(v) ttisnilorempty(v) | ||
163 | 159 | ||
164 | #define isreallyempty(v) checktag((v), LUA_TEMPTY) | 160 | #define isreallyempty(v) checktag((v), LUA_TEMPTY) |
165 | 161 | ||
162 | |||
163 | #if defined(LUA_NILINTABLE) | ||
164 | |||
165 | #define isempty(v) isreallyempty(v) | ||
166 | |||
167 | #else /* By default, entries with any kind of nil are considered empty */ | ||
168 | |||
169 | #define isempty(v) ttisnilorempty(v) | ||
170 | |||
171 | #endif | ||
172 | |||
166 | /* macro defining an empty value */ | 173 | /* macro defining an empty value */ |
167 | #define EMPTYCONSTANT {NULL}, LUA_TEMPTY | 174 | #define EMPTYCONSTANT {NULL}, LUA_TEMPTY |
168 | 175 | ||