There are four sort methods according to rexxref.pdf, 5.3.6.33 - 5.3.6.36:

  * sort
  * sortWith
  * stableSort
  * stableSortWith

The sort* methods have the following documentation in common:

    Sorts the Array of Comparable items into ascending order using an algorithm 
that/is not
    guaranteed to//
    //be stable/, and returns the sorted Array.

The stableSort* methods have the following documentation in common:

    Sorts the Array of Comparable items into ascending order using /a stable 
Mergesort algorithm/, and
    returns the sorted Array.

AFAIK it turned out to be the case that the mergesort algorithm was faster (or 
at least as fast) as
the original (unstable) sort algorithm, such that sort* now also employ the 
stable mergesort algorithm.

Therefore

  * the documentation needs to be corrected, if possible dropping the term 
"stable" as this makes
    newcomers unsecure (does that really mean that the sorting order may be 
changed?) who do not
    know the meaning of "stable" in the context of sort algorithms,

  * the stableSort* versions have become useless and should be either marked 
prominently as
    deprecated in the documentation or left out altogether (but leaving it in 
the interpreter for
    backlevel support).

What do you think?

---rony


_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to