[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Sort function modifies the table being sorted?
- From: Jorge <xxopxe@...>
- Date: Thu, 14 Jun 2012 11:25:22 -0300
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.