$ ADA/LIST SORT_ 1 2 -- This is just the package specification ( The part that is withed ) 3 4 package SORT is 5 6 type INT_ARRAY is array ( INTEGER range <> ) of INTEGER ; 7 8 procedure NNSORT ( SIZE : INTEGER ; 9 ARR1 : in out INT_ARRAY ) ; 10 11 end SORT ; $ ADA/LIST SORT ! This could be compiled last rather than here 1 2 -- This is just the package body 3 4 package body SORT is 5 6 procedure NNSORT ( SIZE : INTEGER ; 7 ARR1 : in out INT_ARRAY ) is 8 TEMP : INTEGER ; 9 begin 10 for I in 1 .. SIZE - 1 loop 11 for J in I + 1 .. SIZE loop 12 if ARR1 ( I ) > ARR1 ( J ) then 13 TEMP := ARR1 ( I ) ; 14 ARR1 ( I ) := ARR1 ( J ) ; 15 ARR1 ( J ) := TEMP ; 16 end if ; 17 end loop ; 18 end loop ; 19 end NNSORT ; 20 21 end SORT ; $ ADA/LIST SORT_TEST 1 with SORT ; use SORT ; 2 with TEXT_IO ; use TEXT_IO ; 3 4 procedure SORT_TEST is 5 6 package INT_IO is new INTEGER_IO ( INTEGER ) ; 7 8 use INT_IO ; 9 DATA : INT_ARRAY ( 1 .. 9 ) := ( 7 , 4 , 9 , 2 , 1 , 3 , 6 , 5 , 8 ) ; 10 SIZE : INTEGER := 9 ; 11 begin 12 13 NNSORT ( SIZE , DATA ) ; 14 15 for I in 1 .. SIZE loop 16 PUT ( DATA( I )) ; 17 NEW_LINE ; 18 end loop ; 19 20 end SORT_TEST ; The following is the file SORT.COM used to test above code $ SET VERIFY $ ADA/LIST SORT_ $ ADA/LIST SORT_TEST ! \__ either order is OK $ ADA/LIST SORT ! / $ ACS LINK SORT_TEST $ RUN SORT_TEST The results of execution are : 1 2 3 4 5 6 7 8 9 Note that in general, the main procedure is compiled last and then linked. When a change is needed only in the body of a package then only the body needs to be recompiled. ( In the advanced class it will be explained why the above statement is not true for generic packages or when the pragma INLINE is used implicitly or explicitly )