[net.lang.ada] Generic list processing

rrw@ccird1.UUCP (Rick Wessman) (06/10/86)

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