title: Ada: how to solve "Circular Unit Dependency"?
body: <p>Suppose I have two records: <em>Person</em> and <em>Animal</em>. Each record is in a separate package.</p>
  
  <p>Package persons:</p>
  
  <pre><code>with animals;
  use animals;
  
  package persons is 
  
      type person is record
       ...
       animalref: animalPOINTER;
       ...
      end record;
  
      type personPOINTER is access person;
  
  end persons;
  </code></pre>
  
  <p>Package animals:</p>
  
  <pre><code>with persons;
  use persons;
  
  package animals is 
      type animal is record
       ...
       ownerref:  personPOINTER;
       ...
      end record;
  
      type animalPOINTER is access animal;
  
  end animals;
  </code></pre>
  
  <p>I have Circular Unit Dependency here, and compiler produces fatal error.</p>
  
  <p>Does anyone have a pattern to address such issue ?</p>
  
  <p>Thanks!</p>