in reply to Re^4: sort direction
in thread sort direction

I'm not sure what your point is; mine was that sort is expected to be stable, which means that reversing $a and $b and reversing the return of sort will produce opposite orders for elements that compare as equal by the compare function. I used overload to demonstrate that this holds even when the two elements have the same string and numeric value. Making the elements take varying numeric values doesn't seem to me to be at all related.

Replies are listed 'Best First'.
Re^6: sort direction
by BrowserUk (Patriarch) on Oct 10, 2005 at 07:28 UTC

    Sorry ysth. What you were demonstrating with your use of overload went right over my head (a mention of sort stability would have been a cluebat).


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
      I should have applied the cluebat in my first response to you; sorry. In my initial post I purposefully didn't because I was hoping people would stop and ponder why there was the difference.