generic
	type Item is private;

package Stacks is

	type Stack( Capacity: Positive ) is tagged limited private;

	Illegal_Use: exception;

	function Size( S: Stack ) return Natural;

	procedure Empty( S: in out Stack );

	procedure Push( S: in out Stack; I: in Item );
	-- if Size(S) = S.Capacity, then Illegal_Use is raised

	procedure Pop( S: in out Stack );
	-- if Size(S) = 0, then Illegal_Use is raised

	function Top( S: Stack ) return Item;
	-- if Size(S) = 0, then Illegal_Use is raised

private

	type Item_Array is array( Positive range <> ) of Item;

	type Stack( Capacity: Positive ) is tagged limited record
		Size: Natural := 0;
		Data: Item_Array(1..Capacity);
		end record;

end Stacks;