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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.232.164 with SMTP id tp4mr17482892obc.29.1407621219974; Sat, 09 Aug 2014 14:53:39 -0700 (PDT) X-Received: by 10.140.105.200 with SMTP id c66mr419051qgf.4.1407621219946; Sat, 09 Aug 2014 14:53:39 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h18no17131893igc.0!news-out.google.com!j6ni34289qas.0!nntp.google.com!j15no5862418qaq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 9 Aug 2014 14:53:39 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=188.115.15.232; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 188.115.15.232 References: <85a97spo1c.fsf@stephe-leake.org> <92dd7d22-a7da-44d7-9c40-b3aa62881683@googlegroups.com> <4f431041-5292-434d-988e-46d69f4800f8@googlegroups.com> <472a5732-3dc9-4c08-8bda-00720375a2a9@googlegroups.com> <8cc86d41-2c7e-42d7-b057-1f9f010d9002@googlegroups.com> <75864d79-609c-4e37-98d8-6b5f050ad59d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <42e0f58b-63c4-4a08-90ce-b5ddf7ebe95b@googlegroups.com> Subject: Re: Problem with generic linked list package From: Laurent Injection-Date: Sat, 09 Aug 2014 21:53:39 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:21632 Date: 2014-08-09T14:53:39-07:00 List-Id: >Now, suppose you have a type T for which "<" is not meaningful. You want t= o have=20 >a linked list of T, but will never use Insert_In_Order. Can you still use = your=20 >package to do this? If not, how could you change your package to support t= his,=20 >while still providing Insert_In_Order for types with "<"?=20 Yes indeed if Element would be a record then insert_in_order wouldn't work = as it is. Because "<" and "=3D" don't exist for this type. Perhaps if I com= pared the components of the record I would but for now I don't see how I wo= uld do that. Problem for later when I have to use my package for a real pro= gram. Otherwise I have some procedures which just add the Element to the front/en= d but the list wouldn't be sorted. =20 "with function "<"(Left, Right : Element) return Boolean is <>; " That was = introduced with Ada 2005? Because the book I learn from is about Ada 95 and I don't remember having s= een a similar construction or already forgotten. I have both versions of Jo= hn Barnes (2005/2012) but for me it feels like learning to use a phone from= the phone book so I prefer the Ada 95 one which uses a more practical exam= ples to explain. Thanks @everyone for the explanations. Laurent