lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> So, I'd either prefer the same shortcut to be added for __lt and __le, or
> the shortcut be removed from __eq.
> At the very least, it would be nice with some sort of explanation on why the
> shortcut for __eq was added in the first place.

Easy to guess:
for complex objects (e. g., 4096x4096 matrices) one operation is
better than two.
On the other hand, 'not' operation isn't very expensive.

Just imagine if we try to expand
matrix_a <= matrix_b
into
((matrix_a < matrix_b) or (matrix_a == matrix_b))