-- This example uses the first two compilation units from the previous -- page. ( No changes ) -- -- The test procedure that instantiates GENSUMPKG was changed to -- work on a floating array rather than an integer array, -- generic actual parameters FLOAT and MY_ARRAY are used here. -- -- with TEXT_IO ; use TEXT_IO ; with GENSUMPKG ; procedure TEST_GENSUMPKG is -- modified, changing INTEGER to FLOAT type MY_ARRAY is array ( INTEGER range <> ) of FLOAT ; -- changed STUFF : MY_ARRAY ( 1 .. 3 ) := ( 1.0 , 2.0 , 3.0 ) ; -- changed package FLT_IO is new FLOAT_IO ( FLOAT ) ; -- changed use FLT_IO ; -- changed -- This is the generic instantiation of the package on previous page package MY_SUM is new GENSUMPKG ( ELEMENT => FLOAT , KEY_1 => MY_ARRAY ) ; ----- changed use MY_SUM ; -- optional, could also write MY_SUM.SUM below begin PUT_LINE ( " GENERIC SUM PACKAGE " ) ; SUM ( STUFF ) ; -- call procedure in instantiated package PUT ( STUFF( 1 )) ; PUT_LINE ( " = SUM " ) ; end TEST_GENSUMPKG ; GENERIC SUM PACKAGE \__ note: floating point result 6.00000E+00 = SUM /