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,a644fa9cd1a3869a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-13 06:52:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.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: List container: Insert and Delete Date: Tue, 13 Nov 2001 09:18:38 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9sra40$b8p$1@nh.pace.co.uk> References: <9sn4qm$13g29j$2@ID-25716.news.dfncis.de> <9sok8i$142am0$2@ID-25716.news.dfncis.de> <3BF004F4.F74AE461@boeing.com> <9sp5up$g5o$1@nh.pace.co.uk> <3BF0827A.DCF2213C@acm.org> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1005661120 11545 136.170.200.133 (13 Nov 2001 14:18:40 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 13 Nov 2001 14:18:40 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:16408 Date: 2001-11-13T14:18:40+00:00 List-Id: O.K., but just to be tricky - suppose you pre-allocate a node that is to be used for the next insertion. When an insertion is done, you use that node and attempt to allocate another one. If it fails, the list is full. That probably wouldn't work for all cases such as discriminated or tagged records, where you can't allocate until you know what you want to store, but it is a trick that might be useful in some contexts. Basically, I agree - an unbounded list wouldn't likely have or need an Is_Full function. If you wanted one for consistency, it could always return False. But I see no need that a Bounded package and an Unbounded package have to be plug compatible. You very seldom would want to unplug the one and plug in the other - you take the decision at the time of design and use the package that makes most sense then. Swapping implementations after that would mean some serious regression testing of the software, so you could probably modify it for any incompatibilities along the way and not be that bad off. I think it was Mark Twain who said something about "A foolish consistency is the product of little minds." :-) 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/ "Jeffrey Carter" wrote in message news:3BF0827A.DCF2213C@acm.org... > > The difference, of course, is that you can provide an Is_Full function > for a bounded list, but not for an unbounded list. In both cases an > exception should be raised if an attempt is made to add an element when > that is not possible. >