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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ecfc0548c2df0d76 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-11 04:58:56 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: MI ammunition : linked lists Date: Tue, 11 Nov 2003 12:58:55 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1068555535 17519 217.17.192.37 (11 Nov 2003 12:58:55 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 11 Nov 2003 12:58:55 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:2341 Date: 2003-11-11T12:58:55+00:00 List-Id: * Marius Amado Alves wrote: > On Tue, 2003-11-11 at 09:32, Lutz Donnerhacke wrote: >> type Base is limited tagged record >> d : Datum; >> end record; >> >> package Base_List1 is new Double_Linked_List (Base); use Base_List1; >> package Base_List2 is new Double_Linked_List (List1); use Base_List2; > > I think you've failed to define List1 before using it here. My fault. package Base_List2 is new Double_Linked_List (List1.Object); use Base_List2; > But anyway this does not look like data being shared between lists. generic type Node(<>) is abstract tagged limited private; package Double_Linked_List is type Object is abstract limited new Node with private; type List ist limited private; ... private type Node_Ptr is access all Object; type Object is abstract limited new Node with record next, prev : Node_Ptr := Object'Access; end record; type List is limited record start, end : Node_Ptr := List'Access; end record; end Double_Linked_List; > It looks like a list of lists, which a different thing entirely. > Recursive containers. No, it's a plain mixin. > Actually in the case of data sharing between containers, I don't think > you can escape some sort of pointing. Of course, but you should hide them in the enclosing structure. It's bad design to collect pointers explicitly.