From: Richard.Clavelier@scinfo.u-nancy.fr (Richard Clavelier)
Subject: HELP : linked lists in ADA
Date: 1996/11/26
Date: 1996-11-26T00:00:00+00:00 [thread overview]
Message-ID: <57fpgl$9au@arcturus.ciril.fr> (raw)
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.
next reply other threads:[~1996-11-26 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-11-26 0:00 Richard Clavelier [this message]
1996-11-30 0:00 ` HELP : linked lists in ADA Vincent Celier
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox