-- package for construction and manipulation of integer lists -- authors: Rob Irving, Lorna Love -- final version: 17 January 2001 package Integer_List_Package is type Integer_List_Type is private; procedure Create_Empty_List( L : out Integer_List_Type ); -- creates the empty list L function Is_Empty ( L : Integer_List_Type ) return Boolean; -- returns True if list L is empty, and False otherwise procedure Insert ( I : in Integer; L : in out Integer_List_Type ); -- adds the integer I to the rear of list L -- assumes I is not already present in L procedure Remove ( I : in Integer; L : in out Integer_List_Type ); -- removes the integer I, if it exists, from the list L -- assumes I is present at most once in L procedure Print_List ( L : in Integer_List_Type); -- prints the contents of the list L to standard output function List_Length(L : in Integer_List_Type) return Natural; -- returns the length of the list L private type Node_Type; type Node_Access is access Node_Type; type Node_Type is record Int : Integer; Next : Node_Access; end record; type Integer_List_Type is record First, Last : Node_Access; end record; end Integer_List_Package;