From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a644fa9cd1a3869a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-10 11:27:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!proxad.net!feeder2-1.proxad.net!news2-1.free.fr!not-for-mail Message-ID: <3BED75C8.D9D55263@free.fr> Date: Sat, 10 Nov 2001 19:45:28 +0100 From: Jean-Marc Bourguet X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.10 i586) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: List container strawman 1.2 References: <3BECA3B7.5020702@telepath.com> <87668ivpw8.fsf@deneb.enyo.de> <87d72qfrtd.fsf@deneb.enyo.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Organization: Guest of ProXad - France NNTP-Posting-Date: 10 Nov 2001 20:27:25 MET NNTP-Posting-Host: 212.27.54.74 X-Trace: 1005420445 news2-1.free.fr 32583 212.27.54.74 X-Complaints-To: abuse@proxad.net Xref: archiver1.google.com comp.lang.ada:16236 Date: 2001-11-10T20:27:25+01:00 List-Id: Ted Dennison wrote: > Assume: > package Integer_List is new Containers.Lists.Unbounded (Integer); > > Version 1: > procedure Sort_Increasing is new Integer_List.Sort (Reverse_Order => ">"); > > Version 2: > procedure Sort_Increasing is new Integer_List.Sort (In_Order => "<"); You probably mean "<=" instead of "<". I prefer the In_Order version. > I'm not sure what you mean by "Stable". If you mean some flag will be set and > every insertion after that will also call "Reverse_Order" to keep things sorted > that way, I'd say no. Hmmm. I'd meant to add an "Insert_Sorted" routine for that > issue. Perhaps you were leading up to that. A sorting algorithm is stable if after applying it, the relative order of elements comparing equal is conserved. That's usefull when you want to sort on several keys: you sort several times beginning with the less significant key. For a list, the natural sorting algorithm is merge sort which is stable. -- Jean-Marc