comp.lang.ada
 help / color / mirror / Atom feed
* HELP : linked lists in ADA
@ 1996-11-26  0:00 Richard Clavelier
  1996-11-30  0:00 ` Vincent Celier
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Clavelier @ 1996-11-26  0:00 UTC (permalink / 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.






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-11-30  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-26  0:00 HELP : linked lists in ADA Richard Clavelier
1996-11-30  0:00 ` Vincent Celier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox