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.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,92269a4e820b8fde,start X-Google-Attributes: gid103376,public From: Richard.Clavelier@scinfo.u-nancy.fr (Richard Clavelier) Subject: HELP : linked lists in ADA Date: 1996/11/26 Message-ID: <57fpgl$9au@arcturus.ciril.fr>#1/1 X-Deja-AN: 201039796 content-type: text/plain; charset=iso-8859-1 organization: Universite Henri Poincare - Nancy (France) mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-11-26T00:00:00+00:00 List-Id: Hello, We have to create a forward and backward linked list in Ada. We have the following program (simplified here) : --------------------------------------------------------------------------- task type CELL is entry X_IN (in_v : in INTEGER); entry Y_OUT; end CELL; type CELLULE is record T : CELL; end record; type CELLPOINTER is access CELLULE; task body CELL is forwardLink : CELLPOINTER; backwardLink : CELLPOINTER; begin [...] forwardLink := new CELLULE; -- we should give the new cell a pointer to "this" -- backwardLink := a pointer to the previous cell [...] end CELL; --------------------------------------------------------------------------- We have no problem for the forward link, but for the backward link, we need to know the reference of the current task ("Current" in Eiffel, "this" in C++), to be able to pass it to the task that we create... Does anyone know the solution ? HELP !!! Richard PS: We don't want an object oriented solution.