-- Package body for offset pairs with TEXT_IO; use TEXT_IO; package body fundamentals is package INT_IO is new INTEGER_IO(INTEGER); use INT_IO; -- Two symbols are equal if they have the same length and the same -- characters up to that length function equal(s,t:symbol_type_ptr) return BOOLEAN is l:integer:=t.length; begin return s.length=l and then t.name(1..l)=s.name(1..l); end equal; -- Return the first element of an offset pair, given a pointer to the pair function get_first(o:offset_ptr) return integer is begin return o.first; end get_first; -- Return the second element of an offset pair, given a pointer to the pair function get_second(o:offset_ptr) return integer is begin return o.second; end get_second; -- Print both elements of an offset pair procedure print_offset(o:offset_ptr) is begin PUT(get_first(o)); PUT(':'); PUT(get_second(o)); end; end fundamentals;