comp.lang.ada
 help / color / mirror / Atom feed
* Generic list processing
@ 1986-06-10 11:59 Rick Wessman
  0 siblings, 0 replies; only message in thread
From: Rick Wessman @ 1986-06-10 11:59 UTC (permalink / raw)


I'm trying to put together a generic list processing routine for
a graphics package. Each list that I use is doubly-linked, so I
figured that I could use the same template over and over. However,
when I tried to compile the package, I got the errors shown below.
Can anybody tell me what I'm doing wrong?

Here's the package:

generic
	type LIST_TYPE is private;
	type LIST_POINTER is access LIST_TYPE;
package LIST_OPS is

procedure DELETE (item: LIST_POINTER; head_of_list: in out LIST_POINTER);
end LIST_OPS;
package body LIST_OPS is

procedure DELETE (item: LIST_POINTER;
		head_of_list: in out LIST_POINTER) is
begin

if item = head_of_list and
	then head_of_list.all.next = head_of_list then
-------------------------^A                                                  ###
--### A:error: LRM 4.1.3: inappropriate prefix
	head_of_list := null;
	return;
end if;

-- Otherwise, reset the pointers in the list and free the
-- item.
item.all.previous.all.next := item.all.next;
--------^A                                                                   ###
--------------------------------------^B                                     ###
--### A:error: LRM 4.1.3: inappropriate prefix
--### B:error: LRM 4.1.3: inappropriate prefix
item.all.next.all.previous := item.all.previous;
--------^A                                                                   ###
--------------------------------------^B                                     ###
--### A:error: LRM 4.1.3: inappropriate prefix
--### B:error: LRM 4.1.3: inappropriate prefix

end DELETE;
end LIST_OPS;

			Thanks,
				Rick Wessman
				seismo!rochester!cci632!ccird1!rrw

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1986-06-10 11:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-06-10 11:59 Generic list processing Rick Wessman

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