generic
type Item is private;
package Stacks is
type Stack( Capacity: Positive ) is 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 );
procedure Pop( S: in out Stack );
function Top( S: Stack ) return Item;
private
type Item_Array is array( Positive range <> ) of Item;
type Stack( Capacity: Positive ) is record
Size: Natural := 0;
Data: Item_Array(1..Capacity);
end record;
end Stacks;