Abstract Data TypesAn Example Package Declaration
CONSTANT re : INTEGER := 0;
CONSTANT im : INTEGER := 1;
TYPE complex IS ARRAY (NATURAL RANGE re TO im) OF REAL;
FUNCTION "+" (a, b : complex) RETURN complex;
FUNCTION "-" (a, b : complex) RETURN complex;
FUNCTION "*" (a, b : complex) RETURN complex;
FUNCTION "/" (a, b : complex) RETURN complex;
Notes:
This is a package declaration for a package that implements a complex number data type. Note that the data type is given as well as some standard operators on that type.