title: Computing a list containing the numbers from x to y
body: <p>How can I create a method which takes two numbers and prepare a list from first number to second number.  The first number is always positive and less than second number?  I tried the following but the I am not sure how to have a global variable in Scheme to hold previous values.</p>
  
  <pre><code>(define preplist  
    (let ((temp '())) 
     (lambda (x y) 
       (cond ((= x y) (append temp (list x)))
             (else (append temp (list x))
                   (display x)
                   (preplist (+ x 1) y))))))
  </code></pre>
  
  <p>Expected result is: (preplist 3 7) => (3 4 5 6 7)</p>
  
  <p>Can some one please help to resolve this problem?</p>