Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Sort by first part of line

From: greggirwin:mindspring at: 3-Sep-2002 16:27

Hi Sunanda, My replay to Louis should come in before this, so you'll see that I took a different route. In any case, I wanted to point something out for clarification. << If Rebol's sort were "stable" -- i.e. it kept equal keys in their original sequence, then all you'd need to do is to write your own sort compare routine to compare partial keys. >> REBOL's sort *is* stable, AFAIK, per Holger. If you provide your own comparison function then you need to return -1, 0, or 1 (rather than true/false) and it should still be stable. I haven't done any tests to prove it, so someone please correct me if I'm wrong. --Gregg