begin
comment record RPerson as example of reference to the same record;

	record RDate (integer month, day, year);
	record RPerson (string name, lastname; reference (RDate) birth; string (1) sex; 
					reference (RPerson) father, mother);
	
	procedure PersonWrite(reference(RPerson) value  pers);
	begin
		writeon( name(pers), lastname(pers) );
	end;
	
	reference(RPerson) adam, eve, abel;
	
	adam := RPerson("Adam", " ", RDate(1,1, -7500), "m", null, null);
	eve  := RPerson("Adam", " ", RDate(1,1, -7500), "f", null, null);
	abel := RPerson("Abel", "son of Adam ", RDate(1,1, -7400), "m", adam, eve);
	
	PersonWrite(abel);
	
end.
