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:
Roberto Ierusalimschy
2018-08-24 10:17:54 -03:00
parent f99509581e
commit 8c8a91f2ef
8 changed files with 44 additions and 40 deletions

View File

@@ -13,6 +13,7 @@
/* test Lua with compatibility code */
#define LUA_COMPAT_MATHLIB
#define LUA_COMPAT_LT_LE
#define LUA_DEBUG