title: Scheme: Printing out first n elements of list
body: <p>First off, <a href="https://stackoverflow.com/questions/7986553/scheme-return-a-lst-that-only-contains-the-first-element-of-the-lst">scheme: return a lst that only contains the first element of the lst</a> did not help much, as the question was never really answered, and I followed the contributor's suggestions to no success. Furthermore, I am approaching this with a do loop, and have almost achieved the solution. </p>
  
  <p>I need to make a procedure that will return the first n items in a passed list. For example, (first-n 4 '(5 8 2 9 4 0 8 7)) should give (5 8 2 9).</p>
  
  <p>Here is my approach, the display is there to make sure that the loop is working, which it is:</p>
  
  <pre><code>(define (front-n n list)
    (do ((i 0 (+ i 1)))
      ((&gt; i (- n 1)))
      (display (list-ref list i))))
  </code></pre>
  
  <p>How do I go about making that return a list, or output a list?</p>