|
On 14/06/12 07:23, Peter Cawley wrote:
As has been said, the takeaway message is that table.sort is a black box. Unsorted array goes in, said array goes through a sequence of contortions, and then a sorted array comes out the other side. In particular, those contortions could be anything, so your order function shouldn't expect the array to be in any reasonable state.
Abusing the comparison operator of a sorting function is a classic. http://www.robweir.com/blog/2010/02/microsoft-random-browser-ballot.html Jorge