program function_calls(output); type vector = array [1..10] of integer; ptr_to_node = ^node; node = record data : vector; next : ptr_to_node; end; function make_vector(p:integer) : vector; begin make_vector := vector[otherwise p]; end; function make_node(p:integer) : ptr_to_node; var ptr : ptr_to_node; begin new(ptr); ptr^.data := make_vector(p); make_node := ptr; end; begin { The Extended Pascal standard allows } { function results to be indexed, selected, } { and dereferenced. } writeln(make_node(10)^.data[1]); writeln(make_vector(15)[2]); { Also since pointer values can be used to } { reference variables, pointer functions can } { be dereferenced on the left side of an } { assignment statement. } make_node(10)^.data[1] := 42; end.