[m-dev.] For review: additions to array.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 7 10:55:18 AEDT 2001


On 07-Feb-2001, Thomas Conway <conway at cs.mu.OZ.AU> wrote:
> On Tue, Feb 06, 2001 at 08:07:46PM EST, Fergus Henderson wrote:
> > > +	% array__sort(Array) returns a version of Array sorted
> > > +	% into ascending order.
> > > +	%
> > > +:- func array__sort(array(T)) = array(T).
> > > +:- mode array__sort(array_di) = array_uo is det.
> > 
> > You should document that this sort is not stable
> > (and explain what "stable" means in this context).
> 
> If sort/2 uses compare/3 to compare records, then there is
> no discernable difference between stable and unstable sorting.

Oh, good point.

It would be nice to provide a version of array__sort
that uses a user-defined comparison pred (or function).

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list