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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Generic Embedded List Nodes Date: Thu, 23 Jun 2016 18:36:21 +0300 Organization: Tidorum Ltd Message-ID: 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> <581cb97c-9d81-4a81-9a05-eed0516ce287@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net B7pphwmRzyo5ZlIcSCoq8QzMf1SNKEGkyu8GGTj1h1FBX9WjAN Cancel-Lock: sha1:GYLlxX8EHHq1QHgy/MM60sZk+fA= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 In-Reply-To: <581cb97c-9d81-4a81-9a05-eed0516ce287@googlegroups.com> Xref: news.eternal-september.org comp.lang.ada:30894 Date: 2016-06-23T18:36:21+03:00 List-Id: On 16-06-23 15:37 , Warren wrote: > 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. My example had two embedded list nodes in the object, so the object could be a member of two lists. You can define as many nodes as you like, in the same record type, at the same time. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .