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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7ee10ec601726fbf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-01 09:03:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: why not Date: Thu, 1 Nov 2001 11:35:40 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9rrtkt$bum$1@nh.pace.co.uk> References: <3BC5D730.DA950CC7@boeing.com> <9q4pa7$1ad$1@nh.pace.co.uk> <3BC6ACC8.23EF21BC@free.fr> <3BC71F54.1FFE78FA@boeing.com> <1KGx7.26476$ev2.35117@www.newsranger.com> <3BC7AD82.2A0CCCD4@acm.org> <9qhiqr$af0$1@nh.pace.co.uk> <1nDC7.180$6S7.92255364@newssvr11.news.prodigy.com> <9rjsak$bp3$1@nh.pace.co.uk> <9rmhb9$o1b$1@nh.pace.co.uk> <3BDEF0FE.B55FED9E@san.rr.com> <9rmuqi$es$1@nh.pace.co.uk> <3BDF1F13.4B99361C@san.rr.com> <9rnbtv$5i4$1@nh.pace.co.uk> <3BDF8C59.5020108@mail.com> <9rp9bk$6m9$1@nh.pace.co.uk> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1004632541 12246 136.170.200.133 (1 Nov 2001 16:35:41 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 1 Nov 2001 16:35:41 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:15551 Date: 2001-11-01T16:35:41+00:00 List-Id: I agree. Sorting needs to be inside of the data structure - not done externally. However, it isn't clear if the container should always be sortable or not. For example, if it is implemented as a generic and the parameter is private, you don't have the operations one would need on an ordinal type to do the sorting. (Too bad Ada didn't provide generic parameters of "Ordinal" and "Scalar" so you could presume the existence of comparison or arithmetic operators. Hmmmmm.....) If you bring in "<" and "=" as function parameters, you can then insert/sort in ascending/descending order as required - but now you impose that requirement on all things that might be stored in the container. What if the items being stored are not ordinal? Or you have no need of sorting? You probably need two flavors of list there - one that accepts a private type with no ordinal operations and one that has ordinal operations. Then you need a flavor of unsorted lists that take limited types and have an imported assignment operation. Then you need them in static vs dynamic colors. Then you need them in protected and unprotected genders. Then you need them......... (No wonder they aren't already in the standard! :-) MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Ted Dennison" wrote in message news:PMdE7.8703$xS6.11455@www.newsranger.com... > In article , Matthew Heaney says... > > How can you make sorting separate, when you don't know (and don't have access > to) the internal structure of the collection? A Map might be implemented as a > linked list, or as some sort of binary tree. At the least, your collection will > need some kind of "swap" or "insert_in_the_middle" operation to support this. > Well...I supose if you use the right algorithm and representations, you could > progressively build a new sorted collection from an old unsorted one, then > replace the old one with the new one. >