-- Polymorphic stack example (Stack User) -- in Ada from page 249 of -- Kenneth C. Louden, Programming Languages -- Principles and Practice 2nd Edition -- Copyright (C) Brooks-Cole/ITP, 2003 with Text_IO; use Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Stacks; -- import the Stacks package procedure StackUsr is package IntStacks is new Stacks(integer); -- instantiate the parameterized package -- with type integer use IntStacks; -- without this, we must write use the package name -- before all of its components, e.g. IntStacks.Stack, -- IntStacks.StackNode, IntStacks.pop, etc. s: Stack := new StackNode; t: integer; begin s.data := 3; s.next := null; t := top(s); -- t is now 3 put(t); end StackUsr;