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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable 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:25:23 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stueberl.de!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Marius Amado Alves Newsgroups: comp.lang.ada Subject: Re: MI ammunition : linked lists Date: Tue, 11 Nov 2003 12:24:32 +0000 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1068553503 96365 80.67.180.195 (11 Nov 2003 12:25:03 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 11 Nov 2003 12:25:03 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: X-Mailer: Ximian Evolution 1.4.5 X-OriginalArrivalTime: 11 Nov 2003 12:24:05.0096 (UTC) FILETIME=[B26DC680:01C3A84E] X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:2336 Date: 2003-11-11T12:24:32+00:00 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. But anyway this does not look like data being shared between lists. It looks like a list of lists, which a different thing entirely. Recursive containers. A fascinating subject, because there is so many ways to do it, depending on many factors, the principal perhaps being the features of the container library used. I also abhor pointers, and prefer static polymorphism. I discuss this in AI-302, and possibly in Ada-Europe 2004. Actually in the case of data sharing between containers, I don't think you can escape some sort of pointing. But you can avoid access types. With the proper container library, you can select one container to be the "master" (not in the ARM sense), and then make the elements of a second container reference the elements of the master in terms of iterators or whatever types the master provides for element identification.