lua-users home
lua-l archive

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

> If it's calling your order function with nil as an argument, and
> throwing the "invalid order function" error only after that, then it
> seems like it simply hasn't figured out that your function is invalid
> at that point, so it can't reasonably be expected to say so.

No. Calling the comparison function with an argument which is not one
of the elements to be sorted, CANT yield ANY additional information
about the validity of the comparison function.

IMHO, Henk is right. It's almost certainly two of-by-one errors in
ltablib.c. I did some pretty extensive testing, and with his proposed
changes, there are no more redundant nil- calls to the comparison
function, while invalid comparison functions are still reported
(although not ALL invalid comparison functions, but nobody asked for
that, anyway) in ---from what i can tell--- just as many cases as