title: How to reverse list in Scheme?
body: <pre><code>(define (list-without-last-pair items)
    (let ((s (cdr items)))
      (if (null? s)
      null
      (cons (car items)
            (list-without-last-pair s)))))
  
  (define (only-last-pair items)
    (let ((s (cdr items)))
      (if (null? s)
          (car items)
          (only-last-pair s))))
  
  (define (reverse items)
    (if (null? items)
         null
         (cons (only-last-pair items)
               (reverse (list-without-last-pair items)))))
  </code></pre>
  
  <p>I have a lot of code duplication inside my main method and auxiliary methods. How to avoid that and improve the solution?</p>
  
  <p>Expected output: <code>(reverse (list 1 2 3))</code> => <code>(3 2 1)</code></p>