-- Code of Figure 5.26, page 166 from
-- 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 Ada.Unchecked_Deallocation;

procedure Fig5_26 is -- added to get compilable program
-- keyword declare unnecessary now
  type Intptr is access Integer;
  procedure delete_int is 
     new Ada.Unchecked_Deallocation(Integer,Intptr);
     -- generic procedure instantialtion in Ada 
     -- see Chapter 6
  x: Intptr := new Integer;
begin
  x.all := 2;
  put(x.all); new_line;
  delete_int(x);
end;

