diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-08-24 10:17:54 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-08-24 10:17:54 -0300 |
commit | 8c8a91f2ef7acccb99e3737913faad8d48b39571 (patch) | |
tree | 0807151944b7f7fd00eedfcfe94b4ee26fe25b21 /lstate.h | |
parent | f99509581ee73c1c2dbddb3398e87c098771d31f (diff) | |
download | lua-8c8a91f2ef7acccb99e3737913faad8d48b39571.tar.gz lua-8c8a91f2ef7acccb99e3737913faad8d48b39571.tar.bz2 lua-8c8a91f2ef7acccb99e3737913faad8d48b39571.zip |
Deprecated the emulation of '__le' using '__lt'
As hinted in the manual for Lua 5.3, the emulation of the metamethod
for '__le' using '__le' has been deprecated. It is slow, complicates
the logic, and it is easy to avoid this emulation by defining a proper
'__le' function.
Moreover, often this emulation was used wrongly, with a programmer
assuming that an order is total when it is not (e.g., NaN in
floating-point numbers).
Diffstat (limited to '')
-rw-r--r-- | lstate.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -138,9 +138,11 @@ typedef struct CallInfo { | |||
138 | #define CIST_YPCALL (1<<3) /* call is a yieldable protected call */ | 138 | #define CIST_YPCALL (1<<3) /* call is a yieldable protected call */ |
139 | #define CIST_TAIL (1<<4) /* call was tail called */ | 139 | #define CIST_TAIL (1<<4) /* call was tail called */ |
140 | #define CIST_HOOKYIELD (1<<5) /* last hook called yielded */ | 140 | #define CIST_HOOKYIELD (1<<5) /* last hook called yielded */ |
141 | #define CIST_LEQ (1<<6) /* using __lt for __le */ | 141 | #define CIST_FIN (1<<6) /* call is running a finalizer */ |
142 | #define CIST_FIN (1<<7) /* call is running a finalizer */ | 142 | #define CIST_TRAN (1<<7) /* 'ci' has transfer information */ |
143 | #define CIST_TRAN (1<<8) /* 'ci' has transfer information */ | 143 | #if defined(LUA_COMPAT_LT_LE) |
144 | #define CIST_LEQ (1<<8) /* using __lt for __le */ | ||
145 | #endif | ||
144 | 146 | ||
145 | /* active function is a Lua function */ | 147 | /* active function is a Lua function */ |
146 | #define isLua(ci) (!((ci)->callstatus & CIST_C)) | 148 | #define isLua(ci) (!((ci)->callstatus & CIST_C)) |