From 8c8a91f2ef7acccb99e3737913faad8d48b39571 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 24 Aug 2018 10:17:54 -0300 Subject: 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). --- luaconf.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index cc8e1bdc..126257dc 100644 --- a/luaconf.h +++ b/luaconf.h @@ -295,7 +295,7 @@ */ /* -@@ LUA_COMPAT_5_3 controls other macros for compatibility with Lua 5.2. +@@ LUA_COMPAT_5_3 controls other macros for compatibility with Lua 5.3. ** You can define it to get all options, or change specific options ** to fit your specific needs. */ @@ -316,6 +316,12 @@ */ #define LUA_COMPAT_APIINTCASTS +/* +@@ LUA_COMPAT_LT_LE controls the emulation of the '__le' metamethod +** using '__lt'. +*/ +#define LUA_COMPAT_LT_LE + #endif /* } */ -- cgit v1.2.3-55-g6feb