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=-0.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,18d9341bd1071f86 X-Google-Attributes: gid103376,public From: "Antonio Dur�n Dom�nguez" Subject: RE: Mixin with preelaborated element Date: 2000/05/31 Message-ID: <6g9Z4.6398$jq6.21214@telenews.teleline.es>#1/1 X-Deja-AN: 629467636 References: X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: usenet@teleline.es X-Trace: telenews.teleline.es 959783042 192.101.1.126 (Wed, 31 May 2000 16:24:02 MET DST) Organization: Clientes_Teleline X-MSMail-Priority: Normal NNTP-Posting-Date: Wed, 31 May 2000 16:24:02 MET DST Newsgroups: comp.lang.ada Date: 2000-05-31T00:00:00+00:00 List-Id: Why don't implement a circular list so that .Next accesses to List.Start. Lutz Donnerhacke escribi� en el mensaje de noticias slrn8j9hrm.mk.lutz@taranis.iks-jena.de... > I run into a problem with my list_mixin. > ftp://ftp.iks-jena.de/pub/mitarb/lutz/ada/types/list_mixin.ad? > > generic > type Base (<>) is abstract tagged limited private; > type S (<>) is abstract new Base with private; > package List_Mixin is > type T is abstract new S with private; > type T_Class is access all T'Class; > type List is limited private; > -- several lines of code deleted > private > type T is abstract new S with > record > Next : T_Class := null; > Used : Boolean := False; -- to detect multiple insertions > end record; > > type List is limited > record > Start : T_Class := null; > end record; > -- several lines of code deleted > end List_Mixin; > > The current implementation use null at the tail marker. This requires the > flag Used and causes a lot of ineffient code. > > So I'd like to introduce a single fixed end node used by all instantiations. > It should contain only the Next element. > > How can I achieve it? > > Using assembly I added the link in front of the structure and ignored the > varying context following it. Good examples can be found in D.E.Knuth TAoCP.