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.46.0.20 with SMTP id 20mr6512011lja.9.1466685469251; Thu, 23 Jun 2016 05:37:49 -0700 (PDT) X-Received: by 10.157.60.49 with SMTP id q46mr482750otc.0.1466685469152; Thu, 23 Jun 2016 05:37:49 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!goblin1!goblin.stu.neva.ru!w10no7788522lbo.0!news-out.google.com!di11ni7891lbb.1!nntp.google.com!w10no7788520lbo.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 23 Jun 2016 05:37:48 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=198.135.236.252; posting-account=ENgozAkAAACH-stq5yXctoDQeZQP2E6J NNTP-Posting-Host: 198.135.236.252 References: <66c14298-c62d-4f4b-b0c0-e969454f9334@googlegroups.com> <2e39857a-7121-476b-807a-d2bff1e598f4@googlegroups.com> <431af616-7df3-4e4d-9262-26ed68cb74c7@googlegroups.com> <037df2b8-b9c4-4447-87ee-cc89d7072b30@googlegroups.com> <15914c54-191c-4f37-b754-282855d1aeaf@googlegroups.com> <3e25c9a0-469c-4487-b78e-6f87434f87fa@googlegroups.com> <2e69ca6f-484c-4d58-b0fe-d17a744b1418@googlegroups.com> <9ada1cdc-2fbd-4009-99f1-aba71ac1b9d2@googlegroups.com> <2954ae98-c4a0-4089-93bc-97854e009785@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <581cb97c-9d81-4a81-9a05-eed0516ce287@googlegroups.com> Subject: Re: Generic Embedded List Nodes From: Warren Injection-Date: Thu, 23 Jun 2016 12:37:49 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:30893 Date: 2016-06-23T05:37:48-07:00 List-Id: On Thursday, 23 June 2016 04:19:35 UTC-4, Niklas Holsti wrote: > On 16-06-23 05:12 , Warren wrote: > > On Tuesday, 21 June 2016 17:38:36 UTC-4, Niklas Holsti wrote: > > ... > >> type Emb_Node_T is tagged; > >> > >> type Emb_Node_Ref_T is access all Emb_Node_T'Class; > >> > >> type Emb_Node_T is tagged record > >> Prev, Next : Emb_Node_Ref_T; > >> -- Prev and Next are null if the node is not in any list. > >> -- When the node is first in a list, Prev points to the list head. > >> -- When the node is last in a list, Next is null. > >> end record; > >> > >> subtype List_T is Emb_Node_T; > >> -- A list head. > >> -- Next points to the first node in the list. > >> -- Prev is null. > > ... > > > > The insertion, traversal and deletes are generally no problem. The problem > > occurs when traversing to access the object. > > Indeed I left out an example of traversal, sorry. No problem. The other issue is that I need to support at least two lists. It gets rather messy when extending the object for each additional list, IMO. I think the large array is going to work best with a list of nodes carrying file descriptors. That's not a general solution but it works where I need it. The array wasn't necessary for the C++ version, but I could have used that there as well. Warren