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).
This commit is contained in:
@@ -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 /* } */
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user