-- filename: liststac.ads 2:15PM 9/1/95 -- the generic parameter to list (and thus list.stacks) is the -- Element type (which is private) -- note that since list.stacks is a child package it has access to -- all the private information of the list package. Thus one COULD, -- though perhaps one shouldn't, make direct use of the -- representation of lists, accessing parts of listnodes. with list; generic package list.stacks is type Stack is new pointer; procedure MkEmpty(S:in out Stack); procedure push(x:in element; onStk:in out Stack); function TopOf(S: in Stack)return element renames first; procedure pop(S: in out Stack); procedure Copy(S1: in Stack; S2: in out Stack); procedure MkSame(S1: in Stack; S2: in out Stack); --function IsEmpty(S: in Stack) return Boolean; --inherited from list --function IsEqual(S1,S2: in Stack) return Boolean; --inherited from list function IsSame(S1,S2: in Stack) return Boolean; Underflow :exception renames NoElements; Overflow: exception; end list.stacks;