title: translating a C for loop to Pascal
body: <p>I am translating an &quot;old&quot; C program into (Object) Pascal.
  I am reconsidering my translation of the following:</p>
  <pre><code>for (objlist = list-&gt;unbounded; objlist; objlist = objlist-&gt;next) {
    /* do stuff */
  }
  </code></pre>
  <p>At first I translated the loop as follows:</p>
  <pre><code>objlist := list.unbounded;
  repeat
    // do stuff
    objlist := objlist.next;
  until objlist = nil;
  </code></pre>
  <p>But then I wondered, what happens if &quot;objList&quot; is nil?
  Should the loop be translated as a while loop (so objList can be tested before entering the loop)?</p>
  <pre><code>objlist := list.unbounded;
  while (objlist &lt;&gt; nil) do
    begin
      // do stuff
      objlist := objlist.next;
    end;
  </code></pre>
  <p>Thanks in advance.</p>