title: How to delete the 2nd to last element from a list in Scheme?
body: <p>I'm using Scheme and I'm trying to remove the 2nd to last element in the list recursively.
  This is what I have:</p>
  
  <pre><code>(define delete
    (lambda (num lst)
      (cond 
        ((equal? (length lst) 1) '())
        ((null? lst) '())
        (else (cons (car lst)(delete num (cdr lst)))))))
  
  (define second
    (lambda(lst)
      (delete (- (length lst) 1) lst)))
  
  (second '(1))
  (second '(3 5 6))
  (second '(2 7 8 4 9))
  </code></pre>
  
  <p>returns this:</p>
  
  <pre><code>()
  (3 5)
  (2 7 8 4)
  </code></pre>
  
  <p>When it should return this:</p>
  
  <pre><code>()
  (3 6)
  (2 7 8 9)
  </code></pre>
  
  <p>The (second '(1)) is doing what I intended but I've playing with the other part for a few hours and I'm still at a loss. Any tips or suggestions would be very appreciated at this point.</p>
  
  <p>EDIT:
  Wow, Thank you! It was that one line of missing code -_- Duh me! </p>